Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve injection strategy when multiple wallet extensions are installed #32

Open
GabrielBuragev opened this issue Feb 15, 2023 · 1 comment

Comments

@GabrielBuragev
Copy link

GabrielBuragev commented Feb 15, 2023

Hello Frame People! Wonderful app you have built.

I had some inconvenient experiences after installing your extension for which i believe there is a nicer solution.
I am also willing to implement it but first i want to hear your thought on this.

Here is my experience from a couple of weeks ago:

I was using MetaMask all along for testing and everything in the web3 world worked good up until the point i installed "Frame Companion" extension. From that moment on no dApp worked for me.
Since i was just curious about Frame, installed "Frame Companion" in a rush and forgot to give it a proper try i was unaware that it completely overwrites the window.ethereum object on which many other wallet extensions/dApps depend. This caused all the attempts to connect with MetaMask to any dApp fail.
After some research i found out about this "expected" behavior in your docs. Offering to use MetaMask injection by toggling it inside your extension is nice but doesn't account for the fact that many users are non-technical users and will be left completely in the dark.
In order to be able to toggle the use of MetaMask injection instead of Frame's injection one first needs to connect his desktop app to the extension and thats why i consider this a bug.

I will suggest a few solutions/improvements:

  • Don't try to inject/overwrite anything at window.ethereum until the user has connected his Frame desktop app and Frame Companion extension. At this point he is aware that he can use MetaMask injection inside Frame Companion so it's up to him to decide
  • Never overwrite the window.ethereum but instead add all the injected providers inside window.ethereum.providers so the dApps can decide on which provider they should use for their "Connect via Browser Provider" selection.
    This is how coinbase does it and to me seems like the cleanest approach: https://docs.cloud.coinbase.com/wallet-sdk/docs/injected-provider-guidance
  • Use MetaMask injection by default and give users the option to toggle and use the Frame's injection
@maggo
Copy link

maggo commented Oct 3, 2023

There's a new standard for provider discovery: EIP-6963: Multi Injected Provider Discovery

Would be great if the extension could support it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants