function shutdownApplication(aFlags) {
  var flags = Ci.nsIAppStartup.eForceQuit;

  if (aFlags) {
    flags |= aFlags;
  }

  // Send a request to shutdown the application. That will allow us and other
  // components to finish up with any shutdown code. Please note that we don't
  // care if other components or add-ons want to prevent this via cancelQuit,
  // we really force the shutdown.
  let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
                   createInstance(Components.interfaces.nsISupportsPRBool);
  Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);

  // Use a timer to trigger the application restart, which will allow us to
  // send an ACK packet via jsbridge if the method has been called via Python.
  var event = {
    notify: function(timer) {
      Services.startup.quit(flags);
    }
  }

  var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
  timer.initWithCallback(event, 100, Ci.nsITimer.TYPE_ONE_SHOT);
}
/**
 * Shutdown or restart the application
 *
 * @param {boolean} [aFlags=undefined]
 *        Additional flags how to handle the shutdown or restart. The attributes
 *        eRestarti386 and eRestartx86_64 have not been documented yet.
 * @see https://developer.mozilla.org/nsIAppStartup#Attributes
 */
Shutdown or restart the application
@param {boolean} [aFlags=undefined]
Additional flags how to handle the shutdown or restart. The attributes
eRestarti386 and eRestartx86_64 have not been documented yet.
Shutdown or restart the application @param { boolean } [ aFlags = undefined ] Additional flags how to handle the shutdown or restart . The attributes eRestarti386 and eRestartx86_64 have not been documented yet .
function shutdownApplication(aFlags) {
  var flags = Ci.nsIAppStartup.eForceQuit;
  if (aFlags) {
    flags |= aFlags;
  }
  let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
                   createInstance(Components.interfaces.nsISupportsPRBool);
  Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
  var event = {
    notify: function(timer) {
      Services.startup.quit(flags);
    }
  }
  var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
  timer.initWithCallback(event, 100, Ci.nsITimer.TYPE_ONE_SHOT);
}
function shutdownApplication ( aFlags ) { var flags = Ci . nsIAppStartup . eForceQuit ; if ( aFlags ) { flags |= aFlags ; } let cancelQuit = Components . classes [ "@mozilla.org/supports-PRBool;1" ] . createInstance ( Components . interfaces . nsISupportsPRBool ) ; Services . obs . notifyObservers ( cancelQuit , "quit-application-requested" , null ) ; var event = { notify : function ( timer ) { Services . startup . quit ( flags ) ; } } var timer = Cc [ "@mozilla.org/timer;1" ] . createInstance ( Ci . nsITimer ) ; timer . initWithCallback ( event , 100 , Ci . nsITimer . TYPE_ONE_SHOT ) ; }
Shutdown or restart the application
 @param {boolean} [aFlags=undefined]
        Additional flags how to handle the shutdown or restart.
Shutdown or restart the application @param { boolean } [ aFlags = undefined ] Additional flags how to handle the shutdown or restart .
// Send a request to shutdown the application. That will allow us and other // components to finish up with any shutdown code. Please note that we don't // care if other components or add-ons want to prevent this via cancelQuit, // we really force the shutdown. // Use a timer to trigger the application restart, which will allow us to // send an ACK packet via jsbridge if the method has been called via Python.