MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.01k stars 4.91k forks source link

[Bug]: Coinbase extension (3.16.2 version) blocks MetaMask injection at wndow.ethereum #18760

Closed Somnus007 closed 1 year ago

Somnus007 commented 1 year ago

Describe the bug

When both Coinbase (v 3.16.2) and Metamask (v. 10.28.3) extensions are installed, the first time a page is opened (NOT RELOAD PAGE), MetaMask does not inject its global API at window.ethereum. window.ethereum is entirely from Coinbase at this moment. But if you reload this page, you will see both Metamask and Coinbase providers in window.ethereum

Steps to reproduce

On Chrome (112.0.5615.137 version):

  1. Install Coinbase (v 3.16.2)
  2. Install MetaMask (v. 10.28.3)
  3. open a new page, on Chrome console look for window.ethereum. You should get a window.ethereum which is entirely from Coinbase
  4. Reload the page
  5. On Chrome console look for window.ethereum again, you will see both Metamask and Coinbase providers in window.ethereum

Error messages or log output

No errore message

Version

10.28.3

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

ahollenbach commented 1 year ago

I have observed the page-refresh-required issue as well on Brave, without Coinbase Wallet installed.

On the first page load, only the Brave provider is present, after refresh it's the MetaMask provider. For Brave, my "Default Ethereum wallet" preference is set to "Extension" (aka MetaMask). This only started happening in the past week or two.

Brave: 1.50.121 (Chromium: 112.0.5615.138) MetaMask: 10.29.0

anaamolnar commented 1 year ago

Related to #18157

kevinghim commented 1 year ago

We will probably consider EIP-6963 Multi Injected Provider Discovery in the near future to prevent provider injection collisions.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.

vandan commented 1 year ago

Announced our plans to support EIP-6963.

vandan commented 1 year ago

EIP-6963 Support is now available in v11.4.0 of our Chrome Browser Extension. We recommend modifying your code to adopt EIP-6963. WalletConnect has provided an example here: https://github.com/WalletConnect/EIP6963