-
Notifications
You must be signed in to change notification settings - Fork 389
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
Sticky Defaults: Make Taho-as-default replace MetaMask in almost all cases #3546
Commits on Jul 11, 2023
-
Make TallyWindowProvider compatible with TahoProvider
Also do some internal renaming from Tally to Taho in a few places that aren't externally-facing.
Configuration menu - View commit details
-
Copy full SHA for 13589ff - Browse repository at this point
Copy the full SHA 13589ffView commit details -
Wrap MetaMask-like providers with a proxy for default handling
Rather than try to intercept and swap out or filter provider lists, we now always wrap any provider that looks like MetaMask (right now we look at isMetaMask + make sure there are no is* properties on the provider) with a proxy. That proxy always forwards requests to Taho if the user has set Taho as default, meaning they've explicitly opted into replacing MetaMask with Taho.
Configuration menu - View commit details
-
Copy full SHA for 4279eb8 - Browse repository at this point
Copy the full SHA 4279eb8View commit details -
Masquerade isMetaMask without breaking Taho detection
When Taho is set as default, the wallet router now reports isMetaMask = true, while the Taho provider always reports isMetaMask = false. This allows dApps that support Taho as a first-class provider to see it as itself. In general the Taho provider is less concerned with masquerading as MetaMask, leaving that to the MetaMask wrapper proxy and the wallet router. Additionally, the wrapper only routes an allowlist of methods to Taho to minimize divergence of behavior from MetaMask when it is installed.
Configuration menu - View commit details
-
Copy full SHA for af75805 - Browse repository at this point
Copy the full SHA af75805View commit details -
Rearrange ethereum.providers based on Taho default setting
Some frameworks, like Wagmi, always display the first item in the providers list as the injected/browser wallet. Some sites that do this also don't check the providers list for other wallets, so that even if MetaMask is in the providers list, the MetaMask button shown to the user doesn't actually bring up MetaMask, instead showing the MetaMask mobile connection option. To get around this, the providers list is now rearranged when Taho is switched to or from default. When it's set as default, it is placed at the front of the providers list; when it's set as not default, the previous provider it replaced is set as first.
Configuration menu - View commit details
-
Copy full SHA for 5463bc5 - Browse repository at this point
Copy the full SHA 5463bc5View commit details -
Add MetaMask mock when Taho is default and no MetaMask is present
For the specific case where Taho is set as default but MetaMask does not seem to be installed, we now inject a MetaMask-alike in the providers list to allow dApps that only look for MetaMask to work correctly. When Taho is cleared from being default, the MetaMask-alike is removed and the fact that MetaMask is not installed is left as-is for the dApp to detect normally.
Configuration menu - View commit details
-
Copy full SHA for 189eba8 - Browse repository at this point
Copy the full SHA 189eba8View commit details
Commits on Jul 12, 2023
-
Fix
this
references in proxy forwardingWhile no observed behaviors broke on this, the existing invocation strategy could lead to failure if provider-private variables were being accessed, due to a shift in the `this` reference.
Configuration menu - View commit details
-
Copy full SHA for ada7635 - Browse repository at this point
Copy the full SHA ada7635View commit details -
Force params for eth_requestAccounts calls from dApps
Some dApps were sending an extraneous parameter up front as if they were expecting to call wallet_requestPermissions. We now discard that parameter when attaching the dApp title and favicon in the content script. wallet_addEthereumChain remains unchanged.
Configuration menu - View commit details
-
Copy full SHA for 285ebe1 - Browse repository at this point
Copy the full SHA 285ebe1View commit details
Commits on Jul 13, 2023
-
Merge branch 'main' into sticky-defaults
kkosiorowska committedJul 13, 2023 Configuration menu - View commit details
-
Copy full SHA for cf033f4 - Browse repository at this point
Copy the full SHA cf033f4View commit details