mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
this fixes #1573
This commit is contained in:
parent
6d79aa43ba
commit
d34d47032d
@ -1353,7 +1353,7 @@ var tabWatcher = (function() {
|
|||||||
tabs = [];
|
tabs = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var browser, URI, tabId;
|
var browser, tabId;
|
||||||
var tabindex = tabs.length, tab;
|
var tabindex = tabs.length, tab;
|
||||||
while ( tabindex-- ) {
|
while ( tabindex-- ) {
|
||||||
tab = tabs[tabindex];
|
tab = tabs[tabindex];
|
||||||
@ -1361,11 +1361,6 @@ var tabWatcher = (function() {
|
|||||||
if ( browser === null ) {
|
if ( browser === null ) {
|
||||||
continue;
|
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);
|
tabId = browserToTabIdMap.get(browser);
|
||||||
if ( tabId !== undefined ) {
|
if ( tabId !== undefined ) {
|
||||||
removeBrowserEntry(tabId, browser);
|
removeBrowserEntry(tabId, browser);
|
||||||
|
@ -193,6 +193,17 @@ vAPI.messaging = {
|
|||||||
if ( typeof self.outerShutdown === 'function' ) {
|
if ( typeof self.outerShutdown === 'function' ) {
|
||||||
outerShutdown();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user