From 3c0a553b098ddac9db8a7842ad905f806563f5d8 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Tue, 15 Oct 2013 11:52:08 -0700 Subject: [PATCH] Bug 919532 - Send quit-application-requested before restarting in safe-mode; r=MattN --- browser/base/content/browser.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 2fb5567de6f9..0186bcaae1fd 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -7127,7 +7127,14 @@ function safeModeRestart() let rv = Services.prompt.confirmEx(window, promptTitle, promptMessage, buttonFlags, restartText, null, null, null, {}); - if (rv == 0) { + if (rv != 0) + return; + + let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] + .createInstance(Ci.nsISupportsPRBool); + Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); + + if (!cancelQuit.data) { Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit); } }