diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2017-11-21 01:38:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 01:38:41 +0800 |
commit | 408bbe726f60c96d3fd2d8132900b822a1ca9fb6 (patch) | |
tree | 37bb8cb76fa032e12afa3eeb231e41eaf4f5c8a7 /app | |
parent | 7a4097e6a69732d25f122bc8a51d903a9c23dd40 (diff) | |
parent | 5ce94e69b311428d9d2f9b5502c02d3b960e380e (diff) | |
download | tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar.gz tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar.bz2 tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar.lz tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar.xz tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.tar.zst tangerine-wallet-browser-408bbe726f60c96d3fd2d8132900b822a1ca9fb6.zip |
Merge pull request #2516 from MetaMask/i2507-DoubleWeb3Error
Add useful error when duplicate web3 is detected.
Diffstat (limited to 'app')
-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') |