aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/phishing-detect.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-12-13 22:37:21 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-06 00:48:24 +0800
commit59a5f550e4131455a790c1ded705b000f0a392ed (patch)
tree77fb403d71f35243240ca7bc5190675c79321c11 /app/scripts/phishing-detect.js
parent697d5adfc857e6e1338167a14757b38eb4d3172c (diff)
downloadtangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar.gz
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar.bz2
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar.lz
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar.xz
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.tar.zst
tangerine-wallet-browser-59a5f550e4131455a790c1ded705b000f0a392ed.zip
Update design of phishing warning screen
Diffstat (limited to 'app/scripts/phishing-detect.js')
-rw-r--r--app/scripts/phishing-detect.js22
1 files changed, 5 insertions, 17 deletions
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 = '<b>To read more about this site and why it was blocked, <a href="https://etherscamdb.info/domain/' + hostname + '"> please navigate here</a>.</b>'
- }
-}
-
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)
-}