Skip to content

Commit

Permalink
Added logic to do mycrypto edit distance after myetherwallet
Browse files Browse the repository at this point in the history
  • Loading branch information
409H committed Feb 9, 2018
1 parent d3b84bd commit 982c165
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/DomainBlacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
});
}

function doBlacklistCheck(arrWhitelistedDomains, arrBlacklistedDomains) {
function doBlacklistCheck(arrWhitelistedDomains, arrBlacklistedDomains)
{
var strCurrentTab = window.location.hostname;
strCurrentTab = strCurrentTab.replace(/www\./g,'');

Expand All @@ -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.
Expand Down

0 comments on commit 982c165

Please sign in to comment.