mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix lint errors
This commit is contained in:
parent
c1ca70d732
commit
0110bd9571
@ -37,13 +37,15 @@ function start() {
|
|||||||
});
|
});
|
||||||
const redirectTarget = new URL(suspect.href, window.location.href);
|
const redirectTarget = new URL(suspect.href, window.location.href);
|
||||||
// validate redirect url
|
// validate redirect url
|
||||||
const invalidProtocol = !(['https:', 'http:'].includes(redirectTarget.protocol));
|
const invalidProtocol = !['https:', 'http:'].includes(
|
||||||
|
redirectTarget.protocol,
|
||||||
|
);
|
||||||
// if in valid, show warning and abort
|
// if in valid, show warning and abort
|
||||||
if (invalidProtocol) {
|
if (invalidProtocol) {
|
||||||
// we intentionally dont display to the user any potential attacker-written content here
|
// we intentionally dont display to the user any potential attacker-written content here
|
||||||
console.error(`Invalid redirect url.`);
|
console.error(`Invalid redirect url.`);
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
// use the validated url instance
|
// use the validated url instance
|
||||||
window.location.href = redirectTarget.href;
|
window.location.href = redirectTarget.href;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user