diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-07-13 06:38:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-13 06:38:49 +0800 |
commit | f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28 (patch) | |
tree | da5d6cecc40b6b32b1ba33cec3aaddf9ae2dfb78 | |
parent | 822ebca3eb4a1e03b88d2e9def11260de44a9f63 (diff) | |
parent | 76a2a59ec54cb20cd482adf724815100916d5d3e (diff) | |
download | tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar.gz tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar.bz2 tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar.lz tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar.xz tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.tar.zst tangerine-wallet-browser-f82f8a9fa46d4fe59b0f9a13313a3a55ce120f28.zip |
Merge pull request #1768 from MetaMask/AddBlacklist
Add first version of phishing site warning
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | app/manifest.json | 6 | ||||
-rw-r--r-- | app/scripts/blacklister.js | 13 | ||||
-rw-r--r-- | circle.yml | 2 | ||||
-rw-r--r-- | gulpfile.js | 1 | ||||
-rw-r--r-- | package.json | 3 |
6 files changed, 24 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3fcfb83..02bebbb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master +- Now detects and blocks known phishing sites. - No longer validate nonce client-side in retry loop. - Fix bug where insufficient balance error was sometimes shown on successful transactions. 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()
+})
+
diff --git a/circle.yml b/circle.yml index 1f018ac24..66eed17d7 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 8.0.0 + version: 8.1.4 dependencies: pre: - "npm i -g testem" diff --git a/gulpfile.js b/gulpfile.js index cc723704a..53de7a7d9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -172,6 +172,7 @@ gulp.task('default', ['lint'], function () { const jsFiles = [ 'inpage', 'contentscript', + 'blacklister', 'background', 'popup', ] diff --git a/package.json b/package.json index 10b175975..a1b1afae1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "npm run dev", "dev": "gulp dev --debug", "disc": "gulp disc --debug", - "dist": "npm install && gulp dist", + "dist": "rm -rf node_modules/etheraddresslookup && npm install && gulp dist", "test": "npm run lint && npm run test-unit && npm run test-integration", "test-unit": "METAMASK_ENV=test mocha --require test/helper.js --recursive \"test/unit/**/*.js\"", "test-integration": "npm run buildMock && npm run buildCiUnits && testem ci -P 2", @@ -68,6 +68,7 @@ "eth-sig-util": "^1.1.1", "eth-simple-keyring": "^1.1.1", "eth-token-tracker": "^1.1.2", + "etheraddresslookup": "github:409H/EtherAddressLookup", "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", |