Skip to content

Commit

Permalink
Fix restartApp(); Closes #197
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed Mar 26, 2016
1 parent 4782a13 commit cb37d9c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions content/modules/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,14 +1503,13 @@ var command = {
function restartApp() {
const nsIAppStartup = Ci.nsIAppStartup;

let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);

os.notifyObservers(cancelQuit, "quit-application-requested", null);
if (cancelQuit.data)
return;

os.notifyObservers(null, "quit-application-granted", null);
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
if (os) {
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
os.notifyObservers(cancelQuit, "quit-application-requested", "restart");
if (cancelQuit.data)
return;
}
let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
let windows = wm.getEnumerator(null);

Expand Down

0 comments on commit cb37d9c

Please sign in to comment.