Add first version of phishing site warning

Links to my own blacklist for now, since I added a package.json for easy importing.

We can point at the main 408H repository once this is merged:
https://github.com/409H/EtherAddressLookup/pull/24

Redirects detected phishing sites [here](https://metamask.io/phishing.html).
This commit is contained in:
Dan Finlay 2017-07-12 13:09:20 -07:00
parent 822ebca3eb
commit 52b92fbe40
4 changed files with 21 additions and 0 deletions

View File

@ -52,6 +52,12 @@
],
"run_at": "document_start",
"all_frames": true
},
{
"run_at": "document_end",
"matches": ["http://*/*", "https://*/*"],
"js": ["scripts/blacklister.js"],
"css": ["css/blacklister.css"]
}
],
"permissions": [

View File

@ -0,0 +1,13 @@
const blacklistedDomains = require('etheraddresslookup/blacklists/domains.json')
function detectBlacklistedDomain() {
var strCurrentTab = window.location.hostname
if (blacklistedDomains && blacklistedDomains.includes(strCurrentTab)) {
window.location.href = 'https://metamask.io/phishing.html'
}
}
window.addEventListener('load', function() {
detectBlacklistedDomain()
})

View File

@ -172,6 +172,7 @@ gulp.task('default', ['lint'], function () {
const jsFiles = [
'inpage',
'contentscript',
'blacklister',
'background',
'popup',
]

View File

@ -68,6 +68,7 @@
"eth-sig-util": "^1.1.1",
"eth-simple-keyring": "^1.1.1",
"eth-token-tracker": "^1.1.2",
"etheraddresslookup": "github:flyswatter/EtherAddressLookup#AddPackageJson",
"ethereumjs-tx": "^1.3.0",
"ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9",
"ethereumjs-wallet": "^0.6.0",