Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r?Gijs
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
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6119,17 +6119,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;
}