mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Support important option for removeparam option
Related discussion: https://github.com/uBlockOrigin/uAssets/issues/29451#issuecomment-3150181993 When transposing a `removeparam` dilter to a DNR rule, the semantic of the `important` option changes to "overrides ` allow` rules".
This commit is contained in:
parent
bb1d085c8c
commit
bbfe7400ac
1 changed files with 6 additions and 1 deletions
|
|
@ -4595,9 +4595,14 @@ StaticNetFilteringEngine.prototype.dnrFromCompiled = function(op, context, ...ar
|
|||
seen.clear();
|
||||
|
||||
// Adjust `important` priority
|
||||
// Mind:
|
||||
// - https://github.com/uBlockOrigin/uAssets/issues/29451#issuecomment-3150181993
|
||||
for ( const rule of ruleset ) {
|
||||
if ( rule.__important !== true ) { continue; }
|
||||
if ( rule.priority === undefined ) { continue; }
|
||||
if ( rule.priority === undefined ) {
|
||||
if ( rule.__modifierType !== 'removeparam' ) { continue; }
|
||||
rule.priority ||= 0;
|
||||
}
|
||||
rule.priority += 30;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue