From 7d2d71bcbc9779b7a25f56a67264cac876356869 Mon Sep 17 00:00:00 2001 From: hahnmichaelf Date: Mon, 13 Aug 2018 12:40:16 -0400 Subject: change name --- app/scripts/phishing-detect.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/scripts/phishing-detect.js (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js new file mode 100644 index 000000000..ae5991586 --- /dev/null +++ b/app/scripts/phishing-detect.js @@ -0,0 +1,5 @@ +window.onload = function() { + if (window.location.pathname === "/phishing.html") { + document.getElementById("esdbLink").innerHTML = "To read more about this scam, navigate to: https://etherscamdb.info/domain/" + window.location.hash.substring(1) + "" + } +} -- cgit From 4808ce25ebdc566a13acbb9cb1c6815368b7c4a1 Mon Sep 17 00:00:00 2001 From: hahnmichaelf Date: Mon, 13 Aug 2018 13:16:37 -0400 Subject: fix for lint-test --- app/scripts/phishing-detect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index ae5991586..a66cdb5ac 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,5 +1,5 @@ window.onload = function() { - if (window.location.pathname === "/phishing.html") { - document.getElementById("esdbLink").innerHTML = "To read more about this scam, navigate to: https://etherscamdb.info/domain/" + window.location.hash.substring(1) + "" + if (window.location.pathname === '/phishing.html') { + document.getElementById("esdbLink").innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '' } } -- cgit From e19eb7bc035670d0f05e34840e6565bc1f907de3 Mon Sep 17 00:00:00 2001 From: hahnmichaelf Date: Mon, 13 Aug 2018 13:21:18 -0400 Subject: additional lint-test fix --- app/scripts/phishing-detect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index a66cdb5ac..4168b6618 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,5 +1,5 @@ window.onload = function() { if (window.location.pathname === '/phishing.html') { - document.getElementById("esdbLink").innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '' + document.getElementById('esdbLink').innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '' } } -- cgit From c92fee7771ee1c12729a5a480d63134722332789 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 1 Oct 2018 21:30:40 -0230 Subject: Hook MetaMaskController up with phishing detection page --- app/scripts/phishing-detect.js | 56 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 4168b6618..6baf868c0 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,5 +1,59 @@ window.onload = function() { if (window.location.pathname === '/phishing.html') { - document.getElementById('esdbLink').innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '' + const {hostname} = parseHash() + document.getElementById('esdbLink').innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + hostname + '' } } + +const querystring = require('querystring') +const dnode = require('dnode') +const { EventEmitter } = require('events') +const PortStream = require('extension-port-stream') +const extension = require('extensionizer') +const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex +const { getEnvironmentType } = require('./lib/util') +const ExtensionPlatform = require('./platforms/extension') + +document.addEventListener('DOMContentLoaded', start) + +function start () { + const windowType = getEnvironmentType(window.location.href) + + global.platform = new ExtensionPlatform() + global.METAMASK_UI_TYPE = windowType + + const extensionPort = extension.runtime.connect({ name: windowType }) + const connectionStream = new PortStream(extensionPort) + const mx = setupMultiplex(connectionStream) + setupControllerConnection(mx.createStream('controller'), (err, metaMaskController) => { + if (err) { + 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() + }) + }) +} + +function setupControllerConnection (connectionStream, cb) { + const eventEmitter = new EventEmitter() + const accountManagerDnode = dnode({ + sendUpdate (state) { + eventEmitter.emit('update', state) + }, + }) + 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 From ccab4ee1a408d93f38765e9b6ef3dc33a18befa9 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 10 Oct 2018 01:12:43 -0400 Subject: tests - integration - Add Drizzle tests (#5467) * added drizzle app for testing * working * clean up * clean up script * make build step required * add drizzle-tests to .eslintignore * clean up drizzle run script * lint * use truffle unbox * undo eslintignore changes * revert change * dont use global * dont need this steps * use the new account flow * restore package-lock.json --- app/scripts/phishing-detect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts/phishing-detect.js') diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 6baf868c0..0889c831e 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,4 +1,4 @@ -window.onload = function() { +window.onload = function () { if (window.location.pathname === '/phishing.html') { const {hostname} = parseHash() document.getElementById('esdbLink').innerHTML = 'To read more about this scam, navigate to: https://etherscamdb.info/domain/' + hostname + '' -- cgit