From 859482fff28b75a84e02b80865fd14fb8aaa0c72 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 15 Jan 2015 15:58:14 +0100 Subject: [PATCH] Firefox: fix tab closing issue (pop-up blocking) --- platform/firefox/vapi-background.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 2d60830..b37fd1b 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) ) {