From c06f5e014f60c1a4803d2445f5253ea98a91d8e2 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 16 Oct 2023 11:14:12 -0400 Subject: [PATCH] Prevent redirecting when URL is not transformed Related commit: https://github.com/gorhill/uBlock/commit/2e4525fe3c --- src/js/static-net-filtering.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index abff5c65d..121f51b10 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -5270,6 +5270,7 @@ FilterContainer.prototype.transformRequest = function(fctxt) { const directive = directives[directives.length-1]; if ( (directive.bits & AllowAction) !== 0 ) { return directives; } const redirectURL = new URL(fctxt.url); + if ( directive.value === redirectURL.pathname ) { return; } redirectURL.pathname = directive.value; fctxt.redirectURL = redirectURL.href; return directives;