From 09fef54959742d6d4da412745c4b1e395399557f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 21 Aug 2024 10:56:18 -0400 Subject: [PATCH] [mv3] Ensure `redirect` has priority over`block` Related issue: https://github.com/uBlockOrigin/uBOL-home/issues/187#issuecomment-2301450418 --- src/js/static-net-filtering.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 84d04478d..d7edc01fb 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -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 } ],