Raymond Hill 2018-12-06 10:18:19 -05:00
parent 96703325ea
commit 3075582c72
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 26 additions and 19 deletions

View File

@ -267,7 +267,7 @@ PageStore.factory = function(tabId, context) {
// logger.
PageStore.prototype.init = function(tabId, context) {
var tabContext = µb.tabContextManager.mustLookup(tabId);
const tabContext = µb.tabContextManager.mustLookup(tabId);
this.tabId = tabId;
// 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.internalRedirectionCount = 0;
// https://github.com/uBlockOrigin/uBlock-issues/issues/314
const masterSwitch = tabContext.getNetFilteringSwitch();
this.noCosmeticFiltering = µb.sessionSwitches.evaluateZ(
'no-cosmetic-filtering',
tabContext.rootHostname
) === true;
if (
masterSwitch &&
this.noCosmeticFiltering &&
µb.logger.isEnabled() &&
context === 'tabCommitted'
@ -318,6 +322,8 @@ PageStore.prototype.init = function(tabId, context) {
}
// Support `generichide` filter option.
this.noGenericCosmeticFiltering = masterSwitch !== true;
if ( this.noGenericCosmeticFiltering !== true ) {
this.noGenericCosmeticFiltering = this.noCosmeticFiltering;
if ( this.noGenericCosmeticFiltering !== true ) {
let result = µb.staticNetFilteringEngine.matchStringGenericHide(
@ -340,6 +346,7 @@ PageStore.prototype.init = function(tabId, context) {
);
}
}
}
return this;
};