aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-07-27 06:31:16 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-07-27 06:31:16 +0800
commitaa282b4e3a55d090f27e37cacf850aa5298cfe27 (patch)
tree5c2fafb6e2c9ce84e170c0be88a64d4a24809dc9
parenta6395436653f274b39bbf642a4d502879bd6eb92 (diff)
downloadtangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar.gz
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar.bz2
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar.lz
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar.xz
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.tar.zst
tangerine-wallet-browser-aa282b4e3a55d090f27e37cacf850aa5298cfe27.zip
Give credit where it is due
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/scripts/blacklister.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46de6fd97..bb57870fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,7 @@
## Current Master
- Include stack traces in txMeta's to better understand the life cycle of transactions
-- Enhance blacklister functionality to include levenshtein logic.
+- Enhance blacklister functionality to include levenshtein logic. (credit to @sogoiii and @409H for their help!)
## 3.9.1 2017-7-19
diff --git a/app/scripts/blacklister.js b/app/scripts/blacklister.js
index f4b95a31f..9337599cc 100644
--- a/app/scripts/blacklister.js
+++ b/app/scripts/blacklister.js
@@ -6,6 +6,9 @@ const whitelistedDomains = require('etheraddresslookup/whitelists/domains.json')
const LEVENSHTEIN_TOLERANCE = 4
const LEVENSHTEIN_CHECKS = ['myetherwallet', 'myetheroll', 'ledgerwallet', 'metamask']
+
+// credit to @sogoiii and @409H for their help!
+// Return a boolean on whether or not a phish is detected.
function isPhish(hostname) {
var strCurrentTab = hostname
@@ -30,6 +33,7 @@ function isPhish(hostname) {
window.addEventListener('load', function () {
var hostnameToCheck = window.location.hostname
if (isPhish(hostnameToCheck)) {
+ // redirect to our phishing warning page.
window.location.href = 'https://metamask.io/phishing.html'
}
})