aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-08-04 05:37:21 +0800
committerGitHub <noreply@github.com>2017-08-04 05:37:21 +0800
commitb1311b48c96d873f571e26cad8e4f5d2f61dec25 (patch)
treea23fdd1ce53f23b28264ad20b1bcfea3275cbfe2 /app/scripts/lib
parent15bcbb4941efc66630e9abf1ff27370e759f753d (diff)
parent34b1e8008889d15812cf3a688bd41f62ed7ee385 (diff)
downloadtangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar.gz
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar.bz2
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar.lz
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar.xz
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.tar.zst
tangerine-wallet-browser-b1311b48c96d873f571e26cad8e4f5d2f61dec25.zip
Merge pull request #1852 from MetaMask/blacklist-refactor2
blacklist - use module eth-phishing-detect
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/is-phish.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/app/scripts/lib/is-phish.js b/app/scripts/lib/is-phish.js
deleted file mode 100644
index ce51c353d..000000000
--- a/app/scripts/lib/is-phish.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const levenshtein = require('fast-levenshtein')
-const LEVENSHTEIN_TOLERANCE = 4
-
-// credit to @sogoiii and @409H for their help!
-// Return a boolean on whether or not a phish is detected.
-function isPhish({ hostname, blacklist, whitelist, fuzzylist }) {
-
- // check if the domain is part of the whitelist.
- if (whitelist && whitelist.includes(hostname)) return false
-
- // check if the domain is part of the blacklist.
- if (blacklist && blacklist.includes(hostname)) return true
-
- // check for similar values.
- const levenshteinForm = hostname.replace(/\./g, '')
- const levenshteinMatched = fuzzylist.some((element) => {
- return levenshtein.get(element, levenshteinForm) <= LEVENSHTEIN_TOLERANCE
- })
-
- return levenshteinMatched
-}
-
-module.exports = isPhish