diff --git a/src/js/codemirror/ubo-static-filtering.js b/src/js/codemirror/ubo-static-filtering.js index 70027ae68..04e0abafa 100644 --- a/src/js/codemirror/ubo-static-filtering.js +++ b/src/js/codemirror/ubo-static-filtering.js @@ -288,6 +288,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() { hintHelperRegistered = true; initHints(); } + astParser.options.filterOnHeaders = details.filterOnHeaders === true; }, parser: astParser, }; diff --git a/src/js/messaging.js b/src/js/messaging.js index 39d381ae7..958bf62f6 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -1519,6 +1519,7 @@ const onMessage = function(request, sender, callback) { response.preparseDirectiveHints = sfp.utils.preparser.getHints(); response.expertMode = µb.hiddenSettings.filterAuthorMode; + response.filterOnHeaders = µb.hiddenSettings.filterOnHeaders; } if ( request.hintUpdateToken !== µb.pageStoresToken ) { response.originHints = getOriginHints(); diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 181dfc7cf..0b328328f 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -1221,7 +1221,7 @@ export class AstFilterParser { realBad = isException === false || isNegated || hasValue; break; case NODE_TYPE_NET_OPTION_NAME_HEADER: - realBad = this.expertMode === false || isNegated || hasValue === false; + realBad = this.options.filterOnHeaders !== true || isNegated || hasValue === false; break; case NODE_TYPE_NET_OPTION_NAME_IMPORTANT: realBad = isException || isNegated || hasValue;