mirror of https://github.com/gorhill/uBlock.git
this fixes #516
This commit is contained in:
parent
653e97e03b
commit
3ab9aa46b0
|
@ -41,7 +41,7 @@ vAPI.tabs.onNavigation = function(details) {
|
||||||
if ( details.frameId !== 0 ) {
|
if ( details.frameId !== 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
µb.bindTabToPageStats(details.tabId, details.url);
|
µb.bindTabToPageStats(details.tabId, details.url, 'afterNavigate');
|
||||||
};
|
};
|
||||||
|
|
||||||
// It may happen the URL in the tab changes, while the page's document
|
// It may happen the URL in the tab changes, while the page's document
|
||||||
|
@ -146,16 +146,22 @@ vAPI.tabs.registerListeners();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reuse page store if one exists: this allows to guess if a tab is
|
// Reuse page store if one exists: this allows to guess if a tab is a popup
|
||||||
// a popup.
|
|
||||||
var pageStore = this.pageStores[tabId];
|
var pageStore = this.pageStores[tabId];
|
||||||
|
|
||||||
if ( pageStore ) {
|
// Tab is not bound
|
||||||
if ( pageURL !== pageStore.pageURL || context === 'beforeRequest' ) {
|
if ( !pageStore ) {
|
||||||
pageStore.reuse(pageURL, context);
|
return this.pageStores[tabId] = this.PageStore.factory(tabId, pageURL);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
pageStore = this.pageStores[tabId] = this.PageStore.factory(tabId, pageURL);
|
// https://github.com/gorhill/uBlock/issues/516
|
||||||
|
// If context if 'beforeRequest', do not rebind
|
||||||
|
if ( context === 'beforeRequest' ) {
|
||||||
|
return pageStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( context === 'afterNavigate' ) {
|
||||||
|
pageStore.reuse(pageURL, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pageStore;
|
return pageStore;
|
||||||
|
|
Loading…
Reference in New Issue