MetaMask / MetaMask/metamask-mobile
[Bug]: MetaMask Mobile not rejecting on wallet_getCapabilities unsupported method when connected via WalletConnect / inAppBrowser
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
### Describe the bug
Reported by CoW Swap:
> 1. Mobile browser
> 2. Connect MetaMask mobile wallet via WalletConnect
>
> As I mentioned above, we added EIP5792 support which implies using wallet_getCapabilities method.
> When we do the request, it switches the focus to MetaMask mobile app 🙁
> As you can see on the video, when I change the buying token, it imidiately navigates me to MetaMask.
> We already deployed hotfix for this issue, and disabled EIP5792 for mobile browsers connected via WalletConnect.
> If you want to reproduce it, you can use this link: https://swap-qstbz5egv-cowswap.vercel.app/
> The issue is also reproducible with iMToken wallet, but is not with Trust, just for your information.
> Thank you!
>
> To clarify, wallet_getCapabilities request triggers switching focus to the wallet for some reason, but it should not.
### Expected behavior
MetaMask returns an error on this method as unsupported
### Screenshots/Recordings
https://github.com/user-attachments/assets/3ff019ac-fa26-4aab-9ce0-185ce95220c3
### Steps to reproduce
1. Open MetaMask Mobile inappbrowser
2. Go to https://swap-qstbz5egv-cowswap.vercel.app/
3. Connect MetaMask via WalletConnect
4. Follow the steps in the attached video
### Error messages or log output
```shell
```
### Detection stage
In production (default)
### Version
7.39.0
### Build type
None
### Device
Android
### Operating system
Android
### Additional context
_No response_
### Severity
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.