From 982c16515edc0608ef3107492aa4e8fdda4d5942 Mon Sep 17 00:00:00 2001 From: 409H Date: Fri, 9 Feb 2018 22:57:26 +0000 Subject: [PATCH] Added logic to do mycrypto edit distance after myetherwallet --- js/DomainBlacklist.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/DomainBlacklist.js b/js/DomainBlacklist.js index 8cf97318..87f8022d 100644 --- a/js/DomainBlacklist.js +++ b/js/DomainBlacklist.js @@ -25,7 +25,8 @@ }); } - function doBlacklistCheck(arrWhitelistedDomains, arrBlacklistedDomains) { + function doBlacklistCheck(arrWhitelistedDomains, arrBlacklistedDomains) + { var strCurrentTab = window.location.hostname; strCurrentTab = strCurrentTab.replace(/www\./g,''); @@ -47,6 +48,11 @@ var intHolisticMetric = levenshtein(source, 'myetherwallet'); var intHolisticLimit = 7 // How different can the word be? blHolisticStatus = (intHolisticMetric > 0 && intHolisticMetric < intHolisticLimit) ? true : false; + if(blHolisticStatus === false) { + //Do edit distance against mycrypto + var intHolisticMetric = levenshtein(source, 'mycrypto'); + blHolisticStatus = (intHolisticMetric > 0 && intHolisticMetric < intHolisticLimit) ? true : false; + } } //If it's not in the whitelist and it is blacklisted or levenshtien wants to blacklist it.