mirror of https://github.com/gorhill/uBlock.git
Firefox: fix tab closing issue (pop-up blocking)
This commit is contained in:
parent
97b5ad9ad5
commit
32c7bf854b
|
@ -127,7 +127,9 @@ const contentObserver = {
|
||||||
context = context.contentWindow || context;
|
context = context.contentWindow || context;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ( context !== context.opener ) {
|
||||||
openerURL = context.opener.location.href;
|
openerURL = context.opener.location.href;
|
||||||
|
}
|
||||||
} catch (ex) {}
|
} catch (ex) {}
|
||||||
|
|
||||||
let isPopup = location.spec === 'about:blank' && openerURL;
|
let isPopup = location.spec === 'about:blank' && openerURL;
|
||||||
|
@ -139,7 +141,9 @@ const contentObserver = {
|
||||||
context = context.contentWindow || context;
|
context = context.contentWindow || context;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ( context !== context.opener ) {
|
||||||
openerURL = context.opener.location.href;
|
openerURL = context.opener.location.href;
|
||||||
|
}
|
||||||
} catch (ex) {}
|
} catch (ex) {}
|
||||||
} else {
|
} else {
|
||||||
context = (context.ownerDocument || context).defaultView;
|
context = (context.ownerDocument || context).defaultView;
|
||||||
|
|
|
@ -980,10 +980,17 @@ var httpObserver = {
|
||||||
var tabURI = tab.linkedBrowser.currentURI;
|
var tabURI = tab.linkedBrowser.currentURI;
|
||||||
|
|
||||||
// Probably isn't the best method to identify the source tab
|
// Probably isn't the best method to identify the source tab
|
||||||
if ( tabURI.spec === this.lastRequest.openerURL ) {
|
if ( tabURI.spec !== lastRequest.openerURL ) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
sourceTabId = vAPI.tabs.getTabId(tab);
|
sourceTabId = vAPI.tabs.getTabId(tab);
|
||||||
|
|
||||||
|
if ( sourceTabId !== lastRequest.tabId ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceTabId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.handlePopup(channel.URI, lastRequest.tabId, sourceTabId) ) {
|
if ( this.handlePopup(channel.URI, lastRequest.tabId, sourceTabId) ) {
|
||||||
|
|
Loading…
Reference in New Issue