mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-01 08:39:37 +02:00
Prevent redirecting when URL is not transformed
Related commit: https://github.com/gorhill/uBlock/commit/2e4525fe3c
This commit is contained in:
parent
8b107e1bac
commit
c06f5e014f
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user