mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Bug 1211637 - if there's no docShell (on a local tab) or permitUnload times out (on a remote tab), close the tab, r=billm
MozReview-Commit-ID: Cihru0TVxNc --HG-- extra : rebase_source : 5c9bcee84eb0b1f6daaa1fa8d317fc700fe40909
This commit is contained in:
parent
6724430882
commit
8a285ee959
@ -2368,12 +2368,12 @@
|
|||||||
// processes the event queue and may lead to another removeTab()
|
// processes the event queue and may lead to another removeTab()
|
||||||
// call before permitUnload() returns.
|
// call before permitUnload() returns.
|
||||||
aTab._pendingPermitUnload = true;
|
aTab._pendingPermitUnload = true;
|
||||||
let {permitUnload} = browser.permitUnload();
|
let {permitUnload, timedOut} = browser.permitUnload();
|
||||||
delete aTab._pendingPermitUnload;
|
delete aTab._pendingPermitUnload;
|
||||||
// If we were closed during onbeforeunload, we return false now
|
// If we were closed during onbeforeunload, we return false now
|
||||||
// so we don't (try to) close the same tab again. Of course, we
|
// so we don't (try to) close the same tab again. Of course, we
|
||||||
// also stop if the unload was cancelled by the user:
|
// also stop if the unload was cancelled by the user:
|
||||||
if (aTab.closing || !permitUnload) {
|
if (aTab.closing || (!timedOut && !permitUnload)) {
|
||||||
// NB: deliberately keep the _closedDuringPermitUnload set to
|
// NB: deliberately keep the _closedDuringPermitUnload set to
|
||||||
// true so we keep exiting early in case of multiple calls.
|
// true so we keep exiting early in case of multiple calls.
|
||||||
return false;
|
return false;
|
||||||
|
@ -1312,7 +1312,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (!this.docShell || !this.docShell.contentViewer) {
|
if (!this.docShell || !this.docShell.contentViewer) {
|
||||||
return true;
|
return {permitUnload: true, timedOut: false};
|
||||||
}
|
}
|
||||||
return {permitUnload: this.docShell.contentViewer.permitUnload(), timedOut: false};
|
return {permitUnload: this.docShell.contentViewer.permitUnload(), timedOut: false};
|
||||||
]]>
|
]]>
|
||||||
|
Loading…
Reference in New Issue
Block a user