diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index 1b8780996..dc89afe67 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -305,6 +305,7 @@ RedirectEngine.prototype.tokenToURL = function( /******************************************************************************/ RedirectEngine.prototype.hasToken = function(token) { + if ( token === 'none' ) { return true; } const asDataURI = token.charCodeAt(0) === 0x25 /* '%' */; if ( asDataURI ) { token = token.slice(1); diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 75fb0d663..2f0a494cd 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -4261,8 +4261,13 @@ FilterContainer.parseRedirectRequestValue = function(modifier) { }; FilterContainer.compareRedirectRequests = function(a, b) { - if ( (a.bits & AllowAction) !== 0 ) { return -1; } - if ( (b.bits & AllowAction) !== 0 ) { return 1; } + const abits = a.bits, bbits = b.bits; + if ( abits !== bbits ) { + if ( (abits & Important) !== 0 ) { return 1; } + if ( (bbits & Important) !== 0 ) { return -1; } + if ( (abits & AllowAction) !== 0 ) { return -1; } + if ( (bbits & AllowAction) !== 0 ) { return 1; } + } const { token: atok, priority: aint } = FilterContainer.parseRedirectRequestValue(a.modifier); if ( µb.redirectEngine.hasToken(atok) === false ) { return -1; }