From 0390bb8b8a2c25cd180614d55b37a5433d3350fe Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 30 Jan 2021 15:08:21 -0500 Subject: [PATCH] Fix potential spurious redirection in whitelisted tabless contexts Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1478 --- src/js/traffic.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/traffic.js b/src/js/traffic.js index 5ebf7586b..003ec9a2f 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -323,11 +323,16 @@ const onBeforeBehindTheSceneRequest = function(fctxt) { // use the origin URL as the scope. Most such requests aren't going to // be blocked, so we test for whitelisting and modify the result only // when the request is being blocked. + // + // https://github.com/uBlockOrigin/uBlock-issues/issues/1478 + // Also remove potential redirection when request is to be + // whitelisted. if ( result === 1 && µb.getNetFilteringSwitch(fctxt.tabOrigin) === false ) { result = 2; + fctxt.redirectURL = undefined; fctxt.filter = { engine: 'u', result: 2, raw: 'whitelisted' }; } }