aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-08-03 05:26:10 +0800
committerkumavis <aaron@kumavis.me>2017-08-03 05:26:10 +0800
commitecaa235b5e3331defab75dad72593951fdf37790 (patch)
tree61b6813459085c4797df99986dccc6d3fe40c59e /app/scripts/lib
parentaea5735b29c87d0a9aad3bfa86d854ed9b20bdf7 (diff)
downloadtangerine-wallet-browser-ecaa235b5e3331defab75dad72593951fdf37790.tar.gz
tangerine-wallet-browser-ecaa235b5e3331defab75dad72593951fdf37790.tar.zst
tangerine-wallet-browser-ecaa235b5e3331defab75dad72593951fdf37790.zip
phishing detection - move phishing detection into contentscript and metamask controller
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/inpage-provider.js3
-rw-r--r--app/scripts/lib/is-phish.js6
2 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js
index 8b8623974..fd032a673 100644
--- a/app/scripts/lib/inpage-provider.js
+++ b/app/scripts/lib/inpage-provider.js
@@ -26,6 +26,9 @@ function MetamaskInpageProvider (connectionStream) {
(err) => logStreamDisconnectWarning('MetaMask PublicConfigStore', err)
)
+ // ignore phishing warning message (handled elsewhere)
+ multiStream.ignoreStream('phishing')
+
// connect to async provider
const asyncProvider = self.asyncProvider = new StreamProvider()
pipe(
diff --git a/app/scripts/lib/is-phish.js b/app/scripts/lib/is-phish.js
index 68c09e4ac..21c68b0d6 100644
--- a/app/scripts/lib/is-phish.js
+++ b/app/scripts/lib/is-phish.js
@@ -9,15 +9,15 @@ const LEVENSHTEIN_CHECKS = ['myetherwallet', 'myetheroll', 'ledgerwallet', 'meta
// credit to @sogoiii and @409H for their help!
// Return a boolean on whether or not a phish is detected.
-function isPhish({ hostname, updatedBlacklist = null }) {
+function isPhish({ hostname, blacklist }) {
var strCurrentTab = hostname
// check if the domain is part of the whitelist.
if (whitelistedDomains && whitelistedDomains.includes(strCurrentTab)) { return false }
// Allow updating of blacklist:
- if (updatedBlacklist) {
- blacklistedDomains = blacklistedDomains.concat(updatedBlacklist)
+ if (blacklist) {
+ blacklistedDomains = blacklistedDomains.concat(blacklist)
}
// check if the domain is part of the blacklist.