This commit is contained in:
gorhill 2015-12-17 11:59:39 -05:00
parent 00122f0b75
commit d871f158f6
1 changed files with 7 additions and 3 deletions

View File

@ -444,7 +444,7 @@ vAPI.tabs.onNavigation = function(details) {
} }
var tabContext = µb.tabContextManager.commit(details.tabId, details.url); 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 // https://github.com/chrisaljoudi/uBlock/issues/630
// The hostname of the bound document must always be present in the // 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 // 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` // is supported as I suspect we are going to start to see `ws`, `wss`
// as well soon. // as well soon.
if ( pageStore && tabContext.rawURL.startsWith('http') ) { if (
pageStore.hostnameToCountMap[tabContext.rootHostname] = 0; pageStore &&
tabContext.rawURL.startsWith('http') &&
pageStore.hostnameToCountMap.hasOwnProperty(tabContext.rootHostname) === false
) {
pageStore.hostnameToCountMap[tabContext.rootHostname] = 0x00010000;
} }
}; };