diff options
-rw-r--r-- | CHANGELOG.md | 9 | ||||
-rw-r--r-- | app/manifest.json | 7 | ||||
-rw-r--r-- | app/scripts/blacklister.js | 13 | ||||
-rw-r--r-- | app/scripts/controllers/transactions.js | 1 | ||||
-rw-r--r-- | app/scripts/migrations/017.js | 40 | ||||
-rw-r--r-- | app/scripts/migrations/index.js | 1 | ||||
-rw-r--r-- | circle.yml | 2 | ||||
-rw-r--r-- | gulpfile.js | 1 | ||||
-rw-r--r-- | package.json | 6 |
9 files changed, 76 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3fcfb83..7cb79bee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Current Master +- Now redirects from known malicious sites faster. + +## 3.9.0 2017-7-12 + +- Now detects and blocks known phishing sites. + +## 3.8.6 2017-7-11 + +- Make transaction resubmission more resilient. - 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..7bf757d4c 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.8.5", + "version": "3.9.0", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", @@ -52,6 +52,11 @@ ], "run_at": "document_start", "all_frames": true + }, + { + "run_at": "document_start", + "matches": ["http://*/*", "https://*/*"], + "js": ["scripts/blacklister.js"] } ], "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/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 707543c87..61e96ca13 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -445,6 +445,7 @@ module.exports = class TransactionController extends EventEmitter { || errorMessage.includes('transaction with the same hash was already imported') // other || errorMessage.includes('gateway timeout') + || errorMessage.includes('nonce too low') ) // ignore resubmit warnings, return early if (isKnownTx) return diff --git a/app/scripts/migrations/017.js b/app/scripts/migrations/017.js new file mode 100644 index 000000000..24959cd3a --- /dev/null +++ b/app/scripts/migrations/017.js @@ -0,0 +1,40 @@ +const version = 17 + +/* + +This migration sets transactions who were retried and marked as failed to submitted + +*/ + +const clone = require('clone') + +module.exports = { + version, + + migrate: function (originalVersionedData) { + const versionedData = clone(originalVersionedData) + versionedData.meta.version = version + try { + const state = versionedData.data + const newState = transformState(state) + versionedData.data = newState + } catch (err) { + console.warn(`MetaMask Migration #${version}` + err.stack) + } + return Promise.resolve(versionedData) + }, +} + +function transformState (state) { + const newState = state + const transactions = newState.TransactionController.transactions + newState.TransactionController.transactions = transactions.map((txMeta) => { + if (!txMeta.status === 'failed') return txMeta + if (txMeta.retryCount > 0 && txMeta.retryCount < 2) { + txMeta.status = 'submitted' + delete txMeta.err + } + return txMeta + }) + return newState +} diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index a4f9c7c4d..f4c87499f 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -27,4 +27,5 @@ module.exports = [ require('./014'), require('./015'), require('./016'), + require('./017'), ] 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 06da15179..1f2d0d591 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "start": "npm run dev", "dev": "gulp dev --debug", "disc": "gulp disc --debug", - "dist": "npm install && gulp dist", + "clear": "rm -rf node_modules/eth-contract-metadata && rm -rf node_modules/etheraddresslookup", + "dist": "npm run clear && 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\"", "single-test": "METAMASK_ENV=test mocha --require test/helper.js", @@ -62,12 +63,13 @@ "end-of-stream": "^1.1.0", "ensnare": "^1.0.0", "eth-bin-to-ops": "^1.0.1", - "eth-contract-metadata": "^1.1.3", + "eth-contract-metadata": "^1.1.4", "eth-hd-keyring": "^1.1.1", "eth-query": "^2.1.2", "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", |