From 8443c3bdde0c536a048a0769927b6e012d545299 Mon Sep 17 00:00:00 2001 From: Dan Finlay <542863+danfinlay@users.noreply.github.com> Date: Mon, 9 Nov 2020 10:40:40 -0800 Subject: [PATCH] Warn instead of throw on duplicate web3 and do not inject (#9832) --- app/scripts/inpage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 546f0a362..8982a93f2 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -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)