diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-11-01 00:59:26 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-11-01 00:59:26 +0800 |
commit | 5ce94e69b311428d9d2f9b5502c02d3b960e380e (patch) | |
tree | 5cf9faa35666f8c93f648241e185cb6dfd84c3ae /app/scripts | |
parent | 7bfb08cf3b5ed93d28147e5ddaad18e3aaf49c8b (diff) | |
download | tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar.gz tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar.bz2 tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar.lz tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar.xz tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.tar.zst tangerine-wallet-browser-5ce94e69b311428d9d2f9b5502c02d3b960e380e.zip |
Add useful error when duplicate web3 is detected.
Fixes #2507
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/inpage.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index b6889b00f..9261e7d64 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -31,6 +31,13 @@ var inpageProvider = new MetamaskInpageProvider(metamaskStream) // setup web3 // +if (typeof window.web3 !== 'undefined') { + throw new Error(`MetaMask detected another web3. + MetaMask will not work reliably with another web3 extension. + This usually happens if you have two MetaMasks installed, + or MetaMask and another web3 extension. Please remove one + and try again.`) +} var web3 = new Web3(inpageProvider) web3.setProvider = function () { log.debug('MetaMask - overrode web3.setProvider') |