Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs, a=ritu FIREFOX_46_0b4_BUILD2 FIREFOX_46_0b4_RELEASE
authorMike Conley <mconley@mozilla.com>
Tue, 15 Mar 2016 14:45:38 -0400
changeset 346820 2f6f69a19150e03ad68062f2ac92342afb1ef787
parent 346819 67f7b83a521fc25a3d3ab940416054bdc80c5431
child 346821 4f141612195dfdc9277620152386d70796527d63
push id14450
push userfelipc@gmail.com
push dateFri, 01 Apr 2016 17:48:36 +0000
reviewersGijs, ritu
bugs1255511
milestone46.0
Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs, a=ritu When the application is asked to quit, all windows are checked to see if they can close (which will spawn the permit unload dialogs). Once the user grants the quit via the permit unload dialogs, nsIAppStartup returns true for the shuttingDown attribute, and we know that all windows allowed the shutdown to occur. This means that we don't have to show the permitUnload dialogs again when SessionStore attempts to close the windows when it does its final async window flush during the quit-application-granted observer topic. MozReview-Commit-ID: DOy8ljngnTd
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6174,17 +6174,17 @@ var IndexedDBPromptHelper = {
     timeoutId = setTimeout(timeoutNotification, firstTimeoutDuration);
   }
 };
 
 function CanCloseWindow()
 {
   // Avoid redundant calls to canClose from showing multiple
   // PermitUnload dialogs.
-  if (window.skipNextCanClose) {
+  if (Services.startup.shuttingDown || window.skipNextCanClose) {
     return true;
   }
 
   for (let browser of gBrowser.browsers) {
     let {permitUnload, timedOut} = browser.permitUnload();
     if (timedOut) {
       return true;
     }