On Chrome & Firefox with MM extension in the browser, withdow.ethereum is true but MetaMask isn’t connected.
I get these errors:
MetaMask: Content script lost connection to “MetaMask Background Multiplex”. undefined
contentscript.js:1 MetaMask: Muxed traffic for channel “metamask-provider” failed. undefined
contentscript.js:1 MetaMask: Content script lost connection to “MetaMask Background Legacy Multiplex”. undefined
contentscript.js:1 MetaMask: Muxed traffic between channels “provider” and “metamask-provider” failed. undefined
contentscript.js:1 MetaMask: Muxed traffic for channel “publicConfig” failed. undefined
The problem is the same with detectEthereumProvider from ‘@metamask/detect-provider’
Is there a better way to check if MM is connected? Thanks
Reach out to our helpdesk: https://support.metamask.io 1 and
click the blue “Start a Conversation” button. The bot will ask a few questions then get you connected.
I got a reply in email which isn’t in this thread…
"… Assuming you have your secret recovery phrase for MetaMask wallet written down and know it works to recover, would you be willing to reinstall MetaMask extension to see if this solves your issues?
If above doesn’t work or you don’t have this info, just let me know. "
I’ve tried this, twice now, it doesn’t solve the issue.
I’ve also found, in Chrome reloading the page fixes it. In Firefox this works sometimes, other times not. So automating page reload isn’t an option, the page keeps reloading.
I’m using ethereum._state.isConnected to check if MM is connected. The fact that this flag exists leads me to believe that there will be times when MM is not connected. It’s difficult to come up with an automated solution. As mentioned you can’t reload the page when isConnected is false. I’m going to give the help desk one more shot.