mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
All exceptions filters are exempt from requiring a trusted source
Related feedback: https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-7566154
This commit is contained in:
parent
1e05665bdc
commit
d2b8d990e6
2 changed files with 6 additions and 4 deletions
|
@ -235,8 +235,10 @@ const normalizeRawFilter = function(parser, sourceIsTrusted = false) {
|
|||
if ( reng.aliases.has(token) ) {
|
||||
token = reng.aliases.get(token);
|
||||
}
|
||||
if ( sourceIsTrusted !== true && reng.tokenRequiresTrust(token) ) {
|
||||
return;
|
||||
if ( parser.isException() !== true ) {
|
||||
if ( sourceIsTrusted !== true ) {
|
||||
if ( reng.tokenRequiresTrust(token) ) { return; }
|
||||
}
|
||||
}
|
||||
args[0] = token.slice(0, -3);
|
||||
}
|
||||
|
|
|
@ -1481,7 +1481,7 @@ export class AstFilterParser {
|
|||
case NODE_TYPE_NET_OPTION_NAME_REPLACE: {
|
||||
realBad = abstractTypeCount || behaviorTypeCount || unredirectableTypeCount;
|
||||
if ( realBad ) { break; }
|
||||
if ( this.options.trustedSource !== true ) {
|
||||
if ( isException !== true && this.options.trustedSource !== true ) {
|
||||
this.astError = AST_ERROR_UNTRUSTED_SOURCE;
|
||||
realBad = true;
|
||||
break;
|
||||
|
@ -1496,7 +1496,7 @@ export class AstFilterParser {
|
|||
case NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM:
|
||||
realBad = abstractTypeCount || behaviorTypeCount || unredirectableTypeCount;
|
||||
if ( realBad ) { break; }
|
||||
if ( this.options.trustedSource !== true ) {
|
||||
if ( isException !== true && this.options.trustedSource !== true ) {
|
||||
this.astError = AST_ERROR_UNTRUSTED_SOURCE;
|
||||
realBad = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue