this fixes regression re. popup/popunder blocking for Seamonkey

This commit is contained in:
gorhill 2015-12-01 17:15:31 -05:00
parent 4fd71d4209
commit 11351bca6d
2 changed files with 11 additions and 7 deletions

View File

@ -938,15 +938,19 @@ vAPI.tabs._remove = (function() {
tabBrowser.closeTab(tab);
};
}
return function(tab, tabBrowser) {
return function(tab, tabBrowser, nuke) {
if ( tabBrowser.tabs.length === 1 && nuke ) {
getOwnerWindow(tab).close();
} else {
tabBrowser.removeTab(tab);
}
};
})();
/******************************************************************************/
vAPI.tabs.remove = (function() {
var remove = function(tabId) {
var remove = function(tabId, nuke) {
var browser = tabWatcher.browserFromTabId(tabId);
if ( !browser ) {
return;
@ -955,12 +959,12 @@ vAPI.tabs.remove = (function() {
if ( !tab ) {
return;
}
this._remove(tab, getTabBrowser(getOwnerWindow(browser)));
this._remove(tab, getTabBrowser(getOwnerWindow(browser)), nuke);
};
// Do this asynchronously
return function(tabId) {
vAPI.setTimeout(remove.bind(this, tabId), 10);
return function(tabId, nuke) {
vAPI.setTimeout(remove.bind(this, tabId, nuke), 1);
};
})();

View File

@ -650,7 +650,7 @@ vAPI.tabs.onPopupUpdated = (function() {
// It is a popup, block and remove the tab.
µb.unbindTabFromPageStats(targetTabId);
vAPI.tabs.remove(targetTabId);
vAPI.tabs.remove(targetTabId, true);
return true;
};