mirror of https://github.com/gorhill/uBlock.git
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
|
@ -288,6 +288,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
|
||||||
hintHelperRegistered = true;
|
hintHelperRegistered = true;
|
||||||
initHints();
|
initHints();
|
||||||
}
|
}
|
||||||
|
astParser.options.filterOnHeaders = details.filterOnHeaders === true;
|
||||||
},
|
},
|
||||||
parser: astParser,
|
parser: astParser,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1519,6 +1519,7 @@ const onMessage = function(request, sender, callback) {
|
||||||
response.preparseDirectiveHints =
|
response.preparseDirectiveHints =
|
||||||
sfp.utils.preparser.getHints();
|
sfp.utils.preparser.getHints();
|
||||||
response.expertMode = µb.hiddenSettings.filterAuthorMode;
|
response.expertMode = µb.hiddenSettings.filterAuthorMode;
|
||||||
|
response.filterOnHeaders = µb.hiddenSettings.filterOnHeaders;
|
||||||
}
|
}
|
||||||
if ( request.hintUpdateToken !== µb.pageStoresToken ) {
|
if ( request.hintUpdateToken !== µb.pageStoresToken ) {
|
||||||
response.originHints = getOriginHints();
|
response.originHints = getOriginHints();
|
||||||
|
|
|
@ -1221,7 +1221,7 @@ export class AstFilterParser {
|
||||||
realBad = isException === false || isNegated || hasValue;
|
realBad = isException === false || isNegated || hasValue;
|
||||||
break;
|
break;
|
||||||
case NODE_TYPE_NET_OPTION_NAME_HEADER:
|
case NODE_TYPE_NET_OPTION_NAME_HEADER:
|
||||||
realBad = this.expertMode === false || isNegated || hasValue === false;
|
realBad = this.options.filterOnHeaders !== true || isNegated || hasValue === false;
|
||||||
break;
|
break;
|
||||||
case NODE_TYPE_NET_OPTION_NAME_IMPORTANT:
|
case NODE_TYPE_NET_OPTION_NAME_IMPORTANT:
|
||||||
realBad = isException || isNegated || hasValue;
|
realBad = isException || isNegated || hasValue;
|
||||||
|
|
Loading…
Reference in New Issue