From 1eda47686974f65754042d4f23933730905fdc85 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 16 Jul 2014 17:20:11 -0400 Subject: [PATCH] this fixes #72 --- js/popup.js | 2 +- js/tab.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/popup.js b/js/popup.js index e578f2bbf..b0f948927 100644 --- a/js/popup.js +++ b/js/popup.js @@ -125,7 +125,7 @@ var onTabsReceived = function(tabs) { messaging.ask( q, onStatsReceived ); }; -chrome.tabs.query({ active: true }, onTabsReceived); +chrome.tabs.query({ active: true, currentWindow: true }, onTabsReceived); /******************************************************************************/ diff --git a/js/tab.js b/js/tab.js index a0e189397..b687b3d0e 100644 --- a/js/tab.js +++ b/js/tab.js @@ -108,6 +108,8 @@ return null; } + //console.debug('µBlock> bindTabToPageStats(%d, "%s")', tabId, pageURL); + // Reuse page store if one exists: this allows to guess if a tab is // a popup. var pageStore = this.pageStores[tabId]; @@ -117,13 +119,13 @@ pageStore = this.PageStore.factory(tabId, pageURL); } - //console.log('µBlock> bindTabToPageStats(%d, "%s")', tabId, pageURL); this.pageStores[tabId] = pageStore; return pageStore; }; µBlock.unbindTabFromPageStats = function(tabId) { + //console.debug('µBlock> unbindTabFromPageStats(%d)', tabId); delete this.pageStores[tabId]; };