From bc8c1d00ad728e854b3caf35231d808515058d3f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 14 Apr 2021 10:56:04 -0400 Subject: [PATCH] Remove advanced setting `ignoreScriptInjectFilters` This advanced setting is not really needed, as the same can be accomplished with a broad exception filter such as `#@#+js()`. Related feedback: - https://github.com/gorhill/uBlock/commit/f5b453fae3c77363367cdf9494e90fe276042a72#commitcomment-49499082 --- src/js/background.js | 1 - src/js/scriptlet-filtering.js | 1 - src/js/static-ext-filtering.js | 9 ++++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 5b489da75..0139b2286 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -63,7 +63,6 @@ const µBlock = (( ) => { // jshint ignore:line extensionUpdateForceReload: false, filterAuthorMode: false, filterOnHeaders: false, - ignoreScriptInjectFilters: false, loggerPopupType: 'popup', manualUpdateAssetFetchPeriod: 500, popupFontSize: 'unset', diff --git a/src/js/scriptlet-filtering.js b/src/js/scriptlet-filtering.js index 2ef28ef3c..ad41c508f 100644 --- a/src/js/scriptlet-filtering.js +++ b/src/js/scriptlet-filtering.js @@ -302,7 +302,6 @@ api.retrieve = function(request) { if ( scriptletDB.size === 0 ) { return; } - if ( µb.hiddenSettings.ignoreScriptInjectFilters ) { return; } const reng = µb.redirectEngine; if ( !reng ) { return; } diff --git a/src/js/static-ext-filtering.js b/src/js/static-ext-filtering.js index 4c49a0ee4..b9b9f2fd2 100644 --- a/src/js/static-ext-filtering.js +++ b/src/js/static-ext-filtering.js @@ -180,12 +180,11 @@ if ( iHn !== undefined ) { do { const strId = this.hostnameSlots[iHn+0]; - if ( this.strSlots[strId >>> this.nBits] === value ) { - if ( (strId & exceptionBit) !== 0 ) { - return false; - } - found = true; + const str = this.strSlots[strId >>> this.nBits]; + if ( (strId & exceptionBit) !== 0 ) { + if ( str === value || str === '' ) { return false; } } + if ( str === value ) { found = true; } iHn = this.hostnameSlots[iHn+1]; } while ( iHn !== 0 ); }