Open app in metamask webview directly #2091
-
Hello, I wanted to ask if it is possible to change the MetaMask button in the wallet list so that it does not try to open the connection via Wallet Connect but directly opens the application in MetaMask's webview. I have tried it like this so far without success.
If I use the MetaMask connector from Wagmi, the MetaMask wallet does not get listed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is not currently possible as we use the standard WalletConnect connector to communicate with MetaMask. However, the user can open the dApp within the MetaMask web browser and connect directly via the injected connector. Although WalletConnect can be unreliable, it's best practice to let the user connect from whichever browser they prefer. In the scenario you are describing, the initial dApp session would be tossed out and restarted in the MetaMask in-app browser. This is okay for some dApps, but problem for others that rely on local state. |
Beta Was this translation helpful? Give feedback.
-
I have found a workaround if anyone else is looking here: this hook listens to click events for the metamask button:
|
Beta Was this translation helpful? Give feedback.
This is not currently possible as we use the standard WalletConnect connector to communicate with MetaMask. However, the user can open the dApp within the MetaMask web browser and connect directly via the injected connector. Although WalletConnect can be unreliable, it's best practice to let the user connect from whichever browser they prefer. In the scenario you are describing, the initial dApp session would be tossed out and restarted in the MetaMask in-app browser. This is okay for some dApps, but problem for others that rely on local state.