diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-07-13 04:09:20 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-07-13 04:09:20 +0800 |
commit | 52b92fbe40e221c53e1c93a2e998c65833c2334d (patch) | |
tree | 478cb4188e00691d9dea584636349606feff1e84 /app | |
parent | 822ebca3eb4a1e03b88d2e9def11260de44a9f63 (diff) | |
download | tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar.gz tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar.bz2 tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar.lz tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar.xz tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.tar.zst tangerine-wallet-browser-52b92fbe40e221c53e1c93a2e998c65833c2334d.zip |
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).
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 6 | ||||
-rw-r--r-- | app/scripts/blacklister.js | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/app/manifest.json b/app/manifest.json index f3a1ebeff..ac6364059 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -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": [ diff --git a/app/scripts/blacklister.js b/app/scripts/blacklister.js new file mode 100644 index 000000000..a45265a75 --- /dev/null +++ b/app/scripts/blacklister.js @@ -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()
+})
+
|