1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 23:42:39 +01:00

[mv3] Ensure redirect has priority overblock

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/187#issuecomment-2301450418
This commit is contained in:
Raymond Hill 2024-08-21 10:56:18 -04:00
parent 520f81fcca
commit 09fef54959
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -752,7 +752,7 @@ class FilterImportant {
}
static dnrFromCompiled(args, rule) {
rule.priority = (rule.priority || 1) + 30;
rule.priority = (rule.priority || 0) + 30;
}
static keyFromArgs() {
@ -4313,17 +4313,17 @@ StaticNetFilteringEngine.prototype.dnrFromCompiled = function(op, context, ...ar
}
// Priority:
// Block: 0 (default priority)
// Redirect: 1-9
// Excepted redirect: 11-19
// Block: 1 (default priority)
// Redirect: 2-9
// Excepted redirect: 12-19
// Allow: 20
// Block important: 30
// Redirect important: 31-39
// Redirect important: 32-39
const realms = new Map([
[ BLOCK_REALM, { type: 'block', priority: 0 } ],
[ ALLOW_REALM, { type: 'allow', priority: 20 } ],
[ REDIRECT_REALM, { type: 'redirect', priority: 1 } ],
[ REDIRECT_REALM, { type: 'redirect', priority: 2 } ],
[ REMOVEPARAM_REALM, { type: 'removeparam', priority: 0 } ],
[ CSP_REALM, { type: 'csp', priority: 0 } ],
[ PERMISSIONS_REALM, { type: 'permissions', priority: 0 } ],