Skip to content

Commit c66c8ab

Browse files
authored
Remove usage of querystring from contentscript (#15112)
1 parent 17e7df7 commit c66c8ab

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/scripts/contentscript.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import querystring from 'querystring';
21
import pump from 'pump';
32
import { WindowPostMessageStream } from '@metamask/post-message-stream';
43
import ObjectMultiplex from 'obj-multiplex';
@@ -363,10 +362,10 @@ function blockedDomainCheck() {
363362
*/
364363
function redirectToPhishingWarning(data = {}) {
365364
console.debug('MetaMask: Routing to Phishing Warning page.');
365+
const { hostname, href } = window.location;
366+
const { newIssueUrl } = data;
366367
const baseUrl = process.env.PHISHING_WARNING_PAGE_URL;
367-
window.location.href = `${baseUrl}#${querystring.stringify({
368-
hostname: window.location.hostname,
369-
href: window.location.href,
370-
newIssueUrl: data.newIssueUrl,
371-
})}`;
368+
369+
const querystring = new URLSearchParams({ hostname, href, newIssueUrl });
370+
window.location.href = `${baseUrl}#${querystring}`;
372371
}

0 commit comments

Comments
 (0)