Remove usage of querystring from contentscript (#15112)

feature/default_network_editable
David Walsh 2 years ago committed by GitHub
parent 17e7df7cd8
commit c66c8aba63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      app/scripts/contentscript.js

@ -1,4 +1,3 @@
import querystring from 'querystring';
import pump from 'pump';
import { WindowPostMessageStream } from '@metamask/post-message-stream';
import ObjectMultiplex from 'obj-multiplex';
@ -363,10 +362,10 @@ function blockedDomainCheck() {
*/
function redirectToPhishingWarning(data = {}) {
console.debug('MetaMask: Routing to Phishing Warning page.');
const { hostname, href } = window.location;
const { newIssueUrl } = data;
const baseUrl = process.env.PHISHING_WARNING_PAGE_URL;
window.location.href = `${baseUrl}#${querystring.stringify({
hostname: window.location.hostname,
href: window.location.href,
newIssueUrl: data.newIssueUrl,
})}`;
const querystring = new URLSearchParams({ hostname, href, newIssueUrl });
window.location.href = `${baseUrl}#${querystring}`;
}

Loading…
Cancel
Save