From 01cbe7520dc9afd28d3b43db6203a58e6dcbacdd Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 11 Oct 2021 07:07:41 -0400 Subject: [PATCH] Fix regression with no-cosmetic-filtering switch Related commit: - https://github.com/gorhill/uBlock/commit/c4b7ee80ea7b22d1f870f9a0e09be9de225cf0b3 --- src/js/ublock.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/ublock.js b/src/js/ublock.js index f73b8f25d..a772a4197 100644 --- a/src/js/ublock.js +++ b/src/js/ublock.js @@ -579,12 +579,14 @@ const matchBucket = function(url, hostname, bucket, start) { case 'no-scripting': this.updateToolbarIcon(details.tabId, 0b100); break; - case 'no-cosmetic-filtering': - this.scriptlets.injectDeep( - details.tabId, - details.state ? 'cosmetic-off' : 'cosmetic-on' - ); + case 'no-cosmetic-filtering': { + const scriptlet = details.state ? 'cosmetic-off' : 'cosmetic-on'; + vAPI.tabs.executeScript(details.tabId, { + file: `/js/scriptlets/${scriptlet}.js`, + allFrames: true, + }); break; + } case 'no-large-media': const pageStore = this.pageStoreFromTabId(details.tabId); if ( pageStore !== null ) {