main.js 708 B

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