From d871f158f6230ae39f19f52944f37789b9460537 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 17 Dec 2015 11:59:39 -0500 Subject: [PATCH] this fixes #1076 --- src/js/tab.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index 4b9ce8546..009d63d32 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -444,7 +444,7 @@ vAPI.tabs.onNavigation = function(details) { } var tabContext = µb.tabContextManager.commit(details.tabId, details.url); - var pageStore = µb.bindTabToPageStats(details.tabId, 'afterNavigate'); + var pageStore = µb.bindTabToPageStats(details.tabId, 'tabChanged'); // https://github.com/chrisaljoudi/uBlock/issues/630 // The hostname of the bound document must always be present in the @@ -453,8 +453,12 @@ vAPI.tabs.onNavigation = function(details) { // TODO: Eventually, we will have to use an API to check whether a scheme // is supported as I suspect we are going to start to see `ws`, `wss` // as well soon. - if ( pageStore && tabContext.rawURL.startsWith('http') ) { - pageStore.hostnameToCountMap[tabContext.rootHostname] = 0; + if ( + pageStore && + tabContext.rawURL.startsWith('http') && + pageStore.hostnameToCountMap.hasOwnProperty(tabContext.rootHostname) === false + ) { + pageStore.hostnameToCountMap[tabContext.rootHostname] = 0x00010000; } };