mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Fix incorrect DNR priority for redirect/important filters
This commit is contained in:
parent
9ac12647d1
commit
1d1490523d
1 changed files with 11 additions and 2 deletions
|
|
@ -762,6 +762,10 @@ class FilterImportant {
|
|||
return filterDataAlloc(args[0]);
|
||||
}
|
||||
|
||||
static dnrFromCompiled(args, rule) {
|
||||
rule.__important = true;
|
||||
}
|
||||
|
||||
static keyFromArgs() {
|
||||
}
|
||||
|
||||
|
|
@ -4446,10 +4450,8 @@ StaticNetFilteringEngine.prototype.dnrFromCompiled = function(op, context, ...ar
|
|||
|
||||
const realms = new Map([
|
||||
[ BLOCK_REALM, { type: 'block', priority: 10 } ],
|
||||
[ BLOCK_REALM | IMPORTANT_REALM, { type: 'block', priority: 40 } ],
|
||||
[ ALLOW_REALM, { type: 'allow', priority: 30 } ],
|
||||
[ REDIRECT_REALM, { type: 'redirect', priority: 11 } ],
|
||||
[ REDIRECT_REALM | IMPORTANT_REALM, { type: 'redirect', priority: 41 } ],
|
||||
[ REMOVEPARAM_REALM, { type: 'removeparam', priority: 0 } ],
|
||||
[ CSP_REALM, { type: 'csp', priority: 0 } ],
|
||||
[ PERMISSIONS_REALM, { type: 'permissions', priority: 0 } ],
|
||||
|
|
@ -4510,6 +4512,13 @@ StaticNetFilteringEngine.prototype.dnrFromCompiled = function(op, context, ...ar
|
|||
}
|
||||
}
|
||||
|
||||
// Adjust `important` priority
|
||||
for ( const rule of ruleset ) {
|
||||
if ( rule.__important !== true ) { continue; }
|
||||
if ( rule.priority === undefined ) { continue; }
|
||||
rule.priority += 30;
|
||||
}
|
||||
|
||||
// Collect generichide filters
|
||||
const generichideExclusions = [];
|
||||
const generichideInclusions = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue