1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-18 18:48:45 +02:00

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

View File

@ -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;