mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Make parser take into account filterOnHeaders
setting
Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/1134#issuecomment-1460638431
This commit is contained in:
parent
bbd9470a98
commit
890aabaae9
3 changed files with 3 additions and 1 deletions
|
@ -288,6 +288,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
|
|||
hintHelperRegistered = true;
|
||||
initHints();
|
||||
}
|
||||
astParser.options.filterOnHeaders = details.filterOnHeaders === true;
|
||||
},
|
||||
parser: astParser,
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue