aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json6
-rw-r--r--app/scripts/blacklister.js13
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()
+})
+