Prevent redirecting when URL is not transformed

Related commit:
https://github.com/gorhill/uBlock/commit/2e4525fe3c
This commit is contained in:
Raymond Hill 2023-10-16 11:14:12 -04:00
parent 8b107e1bac
commit c06f5e014f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 0 deletions

View File

@ -5270,6 +5270,7 @@ FilterContainer.prototype.transformRequest = function(fctxt) {
const directive = directives[directives.length-1]; const directive = directives[directives.length-1];
if ( (directive.bits & AllowAction) !== 0 ) { return directives; } if ( (directive.bits & AllowAction) !== 0 ) { return directives; }
const redirectURL = new URL(fctxt.url); const redirectURL = new URL(fctxt.url);
if ( directive.value === redirectURL.pathname ) { return; }
redirectURL.pathname = directive.value; redirectURL.pathname = directive.value;
fctxt.redirectURL = redirectURL.href; fctxt.redirectURL = redirectURL.href;
return directives; return directives;