1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Warn instead of throw on duplicate web3 and do not inject (#9832)

This commit is contained in:
Dan Finlay 2020-11-09 10:40:40 -08:00 committed by GitHub
parent e005a03e75
commit 8443c3bdde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,13 +60,13 @@ initProvider({
// TODO:deprecate:2020
// Setup web3
if (typeof window.web3 !== 'undefined') {
throw new Error(`MetaMask detected another web3.
if (typeof window.web3 === 'undefined') {
// proxy web3, assign to window, and set up site auto reload
setupWeb3(log)
} else {
log.warn(`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.`)
}
// proxy web3, assign to window, and set up site auto reload
setupWeb3(log)