1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-02 08:52:45 +01:00

Firefox: fix tab closing issue (pop-up blocking)

This commit is contained in:
Deathamns 2015-01-15 15:58:14 +01:00
parent 97b5ad9ad5
commit 32c7bf854b
2 changed files with 15 additions and 4 deletions

View File

@ -127,7 +127,9 @@ const contentObserver = {
context = context.contentWindow || context; context = context.contentWindow || context;
try { try {
openerURL = context.opener.location.href; if ( context !== context.opener ) {
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 {
openerURL = context.opener.location.href; if ( context !== context.opener ) {
openerURL = context.opener.location.href;
}
} catch (ex) {} } catch (ex) {}
} else { } else {
context = (context.ownerDocument || context).defaultView; context = (context.ownerDocument || context).defaultView;

View File

@ -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 ) {
sourceTabId = vAPI.tabs.getTabId(tab); continue
}
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) ) {