with browser.tabs.warnOnClose set to true, onBeforeUnload events are executed before user confirmation that tabs are to be closed, r=gavin

This commit is contained in:
Mike Connor 2009-01-21 23:54:26 -08:00
parent 4301671b45
commit ce229d27e9

View File

@ -5554,7 +5554,14 @@ function WindowIsClosing()
{
var cn = gBrowser.tabContainer.childNodes;
var numtabs = cn.length;
var reallyClose = true;
var reallyClose =
closeWindow(false,
function () {
return gBrowser.warnAboutClosingTabs(true);
});
if (!reallyClose)
return false;
for (var i = 0; reallyClose && i < numtabs; ++i) {
var ds = gBrowser.getBrowserForTab(cn[i]).docShell;
@ -5563,16 +5570,7 @@ function WindowIsClosing()
reallyClose = false;
}
if (!reallyClose)
return false;
// closeWindow takes a second optional function argument to open up a
// window closing warning dialog if we're not quitting. (Quitting opens
// up another dialog so we don't need to.)
return closeWindow(false,
function () {
return gBrowser.warnAboutClosingTabs(true);
});
return reallyClose;
}
var MailIntegration = {