mirror of https://github.com/gorhill/uBlock.git
This commit is contained in:
parent
96703325ea
commit
3075582c72
|
@ -267,7 +267,7 @@ PageStore.factory = function(tabId, context) {
|
||||||
// logger.
|
// logger.
|
||||||
|
|
||||||
PageStore.prototype.init = function(tabId, context) {
|
PageStore.prototype.init = function(tabId, context) {
|
||||||
var tabContext = µb.tabContextManager.mustLookup(tabId);
|
const tabContext = µb.tabContextManager.mustLookup(tabId);
|
||||||
this.tabId = tabId;
|
this.tabId = tabId;
|
||||||
|
|
||||||
// If we are navigating from-to same site, remember whether large
|
// If we are navigating from-to same site, remember whether large
|
||||||
|
@ -297,11 +297,15 @@ PageStore.prototype.init = function(tabId, context) {
|
||||||
this.netFilteringCache = NetFilteringResultCache.factory();
|
this.netFilteringCache = NetFilteringResultCache.factory();
|
||||||
this.internalRedirectionCount = 0;
|
this.internalRedirectionCount = 0;
|
||||||
|
|
||||||
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/314
|
||||||
|
const masterSwitch = tabContext.getNetFilteringSwitch();
|
||||||
|
|
||||||
this.noCosmeticFiltering = µb.sessionSwitches.evaluateZ(
|
this.noCosmeticFiltering = µb.sessionSwitches.evaluateZ(
|
||||||
'no-cosmetic-filtering',
|
'no-cosmetic-filtering',
|
||||||
tabContext.rootHostname
|
tabContext.rootHostname
|
||||||
) === true;
|
) === true;
|
||||||
if (
|
if (
|
||||||
|
masterSwitch &&
|
||||||
this.noCosmeticFiltering &&
|
this.noCosmeticFiltering &&
|
||||||
µb.logger.isEnabled() &&
|
µb.logger.isEnabled() &&
|
||||||
context === 'tabCommitted'
|
context === 'tabCommitted'
|
||||||
|
@ -318,26 +322,29 @@ PageStore.prototype.init = function(tabId, context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support `generichide` filter option.
|
// Support `generichide` filter option.
|
||||||
this.noGenericCosmeticFiltering = this.noCosmeticFiltering;
|
this.noGenericCosmeticFiltering = masterSwitch !== true;
|
||||||
if ( this.noGenericCosmeticFiltering !== true ) {
|
if ( this.noGenericCosmeticFiltering !== true ) {
|
||||||
let result = µb.staticNetFilteringEngine.matchStringGenericHide(
|
this.noGenericCosmeticFiltering = this.noCosmeticFiltering;
|
||||||
tabContext.normalURL
|
if ( this.noGenericCosmeticFiltering !== true ) {
|
||||||
);
|
let result = µb.staticNetFilteringEngine.matchStringGenericHide(
|
||||||
this.noGenericCosmeticFiltering = result === 2;
|
tabContext.normalURL
|
||||||
if (
|
|
||||||
result !== 0 &&
|
|
||||||
µb.logger.isEnabled() &&
|
|
||||||
context === 'tabCommitted'
|
|
||||||
) {
|
|
||||||
µb.logger.writeOne(
|
|
||||||
tabId,
|
|
||||||
'net',
|
|
||||||
µb.staticNetFilteringEngine.toLogData(),
|
|
||||||
'generichide',
|
|
||||||
tabContext.rawURL,
|
|
||||||
this.tabHostname,
|
|
||||||
this.tabHostname
|
|
||||||
);
|
);
|
||||||
|
this.noGenericCosmeticFiltering = result === 2;
|
||||||
|
if (
|
||||||
|
result !== 0 &&
|
||||||
|
µb.logger.isEnabled() &&
|
||||||
|
context === 'tabCommitted'
|
||||||
|
) {
|
||||||
|
µb.logger.writeOne(
|
||||||
|
tabId,
|
||||||
|
'net',
|
||||||
|
µb.staticNetFilteringEngine.toLogData(),
|
||||||
|
'generichide',
|
||||||
|
tabContext.rawURL,
|
||||||
|
this.tabHostname,
|
||||||
|
this.tabHostname
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue