Fix regression with no-cosmetic-filtering switch

Related commit:
- c4b7ee80ea
This commit is contained in:
Raymond Hill 2021-10-11 07:07:41 -04:00
parent 895aa34134
commit 01cbe7520d
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 7 additions and 5 deletions

View File

@ -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 ) {