diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 8fa551980..ad24e495f 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -127,7 +127,9 @@ const contentObserver = { context = context.contentWindow || context; try { - openerURL = context.opener.location.href; + if ( context !== context.opener ) { + openerURL = context.opener.location.href; + } } catch (ex) {} let isPopup = location.spec === 'about:blank' && openerURL; @@ -139,7 +141,9 @@ const contentObserver = { context = context.contentWindow || context; try { - openerURL = context.opener.location.href; + if ( context !== context.opener ) { + openerURL = context.opener.location.href; + } } catch (ex) {} } else { context = (context.ownerDocument || context).defaultView; diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 2d608307e..b37fd1b3d 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -980,10 +980,17 @@ var httpObserver = { var tabURI = tab.linkedBrowser.currentURI; // Probably isn't the best method to identify the source tab - if ( tabURI.spec === this.lastRequest.openerURL ) { - sourceTabId = vAPI.tabs.getTabId(tab); + if ( tabURI.spec !== lastRequest.openerURL ) { + continue + } + + sourceTabId = vAPI.tabs.getTabId(tab); + + if ( sourceTabId !== lastRequest.tabId ) { break; } + + sourceTabId = null; } if ( this.handlePopup(channel.URI, lastRequest.tabId, sourceTabId) ) {