From 59a5f550e4131455a790c1ded705b000f0a392ed Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Thu, 13 Dec 2018 11:07:21 -0330 Subject: Update design of phishing warning screen --- app/scripts/phishing-detect.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 5ef99f181..ff95d1f6f 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,10 +1,3 @@ -window.onload = function () { - if (window.location.pathname === '/phishing.html') { - const {hostname} = parseHash() - document.getElementById('esdbLink').innerHTML = 'To read more about this site and why it was blocked, please navigate here.' - } -} - const querystring = require('querystring') const dnode = require('dnode') const { EventEmitter } = require('events') @@ -18,6 +11,10 @@ document.addEventListener('DOMContentLoaded', start) function start () { const windowType = getEnvironmentType(window.location.href) + const hash = window.location.hash.substring(1) + const suspect = querystring.parse(hash) + + document.getElementById('esdbLink').href = `https://etherscamdb.info/domain/${suspect.hostname}` global.platform = new ExtensionPlatform() global.METAMASK_UI_TYPE = windowType @@ -30,14 +27,10 @@ function start () { return } - const suspect = parseHash() - const unsafeContinue = () => { - window.location.href = suspect.href - } const continueLink = document.getElementById('unsafe-continue') continueLink.addEventListener('click', () => { metaMaskController.whitelistPhishingDomain(suspect.hostname) - unsafeContinue() + window.location.href = suspect.href }) }) } @@ -52,8 +45,3 @@ function setupControllerConnection (connectionStream, cb) { connectionStream.pipe(accountManagerDnode).pipe(connectionStream) accountManagerDnode.once('remote', (accountManager) => cb(null, accountManager)) } - -function parseHash () { - const hash = window.location.hash.substring(1) - return querystring.parse(hash) -} -- cgit