[mv3] Fix conversion of filters with important option

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/266
This commit is contained in:
Raymond Hill 2025-01-10 10:23:54 -05:00
parent f8975e3a6a
commit ab0f4ba0d4
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -769,10 +769,6 @@ class FilterImportant {
return filterDataAlloc(args[0]);
}
static dnrFromCompiled(args, rule) {
rule.priority = (rule.priority || 0) + 30;
}
static keyFromArgs() {
}
@ -4463,13 +4459,17 @@ 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 } ],
[ URLTRANSFORM_REALM, { type: 'uritransform', priority: 0 } ],
[ HEADERS_REALM, { type: 'block', priority: 10 } ],
[ HEADERS_REALM | ALLOW_REALM, { type: 'allow', priority: 30 } ],
[ HEADERS_REALM | IMPORTANT_REALM, { type: 'allow', priority: 40 } ],
[ URLSKIP_REALM, { type: 'urlskip', priority: 0 } ],
]);
const partyness = new Map([