Skip to content

Commit

Permalink
Make parser take into account filterOnHeaders setting
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 8, 2023
1 parent bbd9470 commit 890aaba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/codemirror/ubo-static-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
hintHelperRegistered = true;
initHints();
}
astParser.options.filterOnHeaders = details.filterOnHeaders === true;
},
parser: astParser,
};
Expand Down
1 change: 1 addition & 0 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/js/static-filtering-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 890aaba

Please sign in to comment.