This commit is contained in:
gorhill 2016-04-21 14:34:20 -04:00
parent 6d79aa43ba
commit d34d47032d
2 changed files with 12 additions and 6 deletions

View File

@ -1353,7 +1353,7 @@ var tabWatcher = (function() {
tabs = [];
}
var browser, URI, tabId;
var browser, tabId;
var tabindex = tabs.length, tab;
while ( tabindex-- ) {
tab = tabs[tabindex];
@ -1361,11 +1361,6 @@ var tabWatcher = (function() {
if ( browser === null ) {
continue;
}
URI = browser.currentURI;
// Close extension tabs
if ( URI.schemeIs('chrome') && URI.host === location.host ) {
vAPI.tabs._remove(tab, getTabBrowser(win));
}
tabId = browserToTabIdMap.get(browser);
if ( tabId !== undefined ) {
removeBrowserEntry(tabId, browser);

View File

@ -193,6 +193,17 @@ vAPI.messaging = {
if ( typeof self.outerShutdown === 'function' ) {
outerShutdown();
}
// https://github.com/gorhill/uBlock/issues/1573
// Will let uBO's own web pages close themselves. `window.top` is
// used on the assumption that uBO's own web pages will never be
// embedded in anything else than its own documents.
try {
var top = window.top;
if ( top.location.href.startsWith(vAPI.getURL('')) ) {
top.close();
}
} catch (ex) {
}
return;
}
},