Bug 1349501 - Let _beginRemoveTab skip the whole permitUnload block for tabs that don't have content attached
MozReview-Commit-ID: GQvX8pUxDen
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2625,23 +2625,25 @@
<body>
<![CDATA[
if (aTab.closing ||
this._windowIsClosing)
return false;
var browser = this.getBrowserForTab(aTab);
- if (!aTab._pendingPermitUnload && !aAdoptedByTab && !aSkipPermitUnload) {
+ if (!aTab._pendingPermitUnload &&
+ !aSkipPermitUnload &&
+ aTab.linkedPanel &&
+ !aAdoptedByTab) {
// We need to block while calling permitUnload() because it
// processes the event queue and may lead to another removeTab()
// call before permitUnload() returns.
aTab._pendingPermitUnload = true;
- let {permitUnload, timedOut} = aTab.linkedPanel ?
- browser.permitUnload() : {permitUnload: true, timedOut: false};
+ let {permitUnload, timedOut} = browser.permitUnload();
delete aTab._pendingPermitUnload;
// If we were closed during onbeforeunload, we return false now
// so we don't (try to) close the same tab again. Of course, we
// also stop if the unload was cancelled by the user:
if (aTab.closing || (!timedOut && !permitUnload)) {
// NB: deliberately keep the _closedDuringPermitUnload set to
// true so we keep exiting early in case of multiple calls.
return false;