michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const { Cc, Ci } = require("chrome"); michael@0: michael@0: exports.main = function(options, callbacks) { michael@0: // Close Firefox window. Firefox should quit. michael@0: require("sdk/deprecated/window-utils").activeBrowserWindow.close(); michael@0: michael@0: // But not on Mac where it stay alive! We have to request application quit. michael@0: if (require("sdk/system/runtime").OS == "Darwin") { michael@0: let appStartup = Cc['@mozilla.org/toolkit/app-startup;1']. michael@0: getService(Ci.nsIAppStartup); michael@0: appStartup.quit(appStartup.eAttemptQuit); michael@0: } michael@0: }