brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.06k stars 2.23k forks source link

[Desktop] Provide an in-browser-action UI way to detect when Crypto Wallets is not the selected web3 provider #11696

Closed bbondy closed 3 years ago

bbondy commented 3 years ago

Description

We have a setting for selecting the web3 provider here: brave://settings/extensions

Screen Shot 2020-09-14 at 10 20 45 AM

However, we should also add an indication within our browser action button UI that tells the user when we're not the selected web3 provider.

This can be accomplished with an API which is currently already exposed to both Crypto Wallets and MetaMask: chrome.braveWallet.getWeb3Provider. It returns the extension ID that is the current provider in a callback as the first param.

Steps to Reproduce

  1. Install MetaMask
  2. Verify in settings that Crypto Wallets is not the selected Dapp provider brave://settings/extensions (MetaMask will be)
  3. Go to brave://wallet and login so the Crypto Wallets extension gets loaded
  4. Open the browser action button for Crypto Wallets

Actual result:

No indication that Crypto Wallets is not the current web3 provider for Dapps.

Expected result:

Some indication should be there so a user doesn't wonder why it isn't the web3 provider.

srirambv commented 3 years ago

Verification passed on

Brave 1.17.73 Chromium: 87.0.4280.67 (Official Build) (64-bit)
Revision 0e5d92df40086cf0050c00f87b11da1b14580930-refs/branch-heads/4280@{#1441}
OS Linux
Component 1.0.17 Dev
Brave 1.19.31 Chromium: 87.0.4280.67 (Official Build) nightly (64-bit)
Revision 0e5d92df40086cf0050c00f87b11da1b14580930-refs/branch-heads/4280@{#1441}
OS Windows 10 OS Version 1809 (Build 17763.1577)
Component 1.0.17 Dev
Brave 1.18.61 Chromium: 87.0.4280.67 (Official Build) dev (x86_64)
Revision 0e5d92df40086cf0050c00f87b11da1b14580930-refs/branch-heads/4280@{#1441}
OS macOS Version 10.15.7 (Build 19H2)
Component 1.0.17 Dev