From b63f55b7af5bc3990b3c46f20e3d4d17ad7e4aee Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 30 Dec 2015 17:35:32 -0500 Subject: [PATCH] this fixes #1121: `allow` rule will no longer affect cosmetic filtering. the per-site cosmetic filtering switch must be used instead. --- src/js/pagestore.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/js/pagestore.js b/src/js/pagestore.js index 0ce3a0688..39198d9af 100644 --- a/src/js/pagestore.js +++ b/src/js/pagestore.js @@ -447,23 +447,16 @@ PageStore.prototype.getNetFilteringSwitch = function() { /******************************************************************************/ PageStore.prototype.getSpecificCosmeticFilteringSwitch = function() { - var tabContext = µb.tabContextManager.mustLookup(this.tabId); - - if ( µb.hnSwitches.evaluateZ('no-cosmetic-filtering', tabContext.rootHostname) ) { - return false; - } - - return µb.userSettings.advancedUserEnabled === false || - µb.sessionFirewall.mustAllowCellZY(tabContext.rootHostname, tabContext.rootHostname, '*') === false; + var tabContext = µb.tabContextManager.lookup(this.tabId); + return tabContext !== null && + µb.hnSwitches.evaluateZ('no-cosmetic-filtering', tabContext.rootHostname) !== true; }; /******************************************************************************/ PageStore.prototype.getGenericCosmeticFilteringSwitch = function() { - if ( this.skipCosmeticFiltering ) { - return false; - } - return this.getSpecificCosmeticFilteringSwitch(); + return this.skipCosmeticFiltering !== true && + this.getSpecificCosmeticFilteringSwitch(); }; /******************************************************************************/