Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInstall and lazy loading of Crypto Wallets #9757
Open
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
Due to the way we implicitly download the Crypto Wallets extension (MetaMask fork) on first use, we have several users that have extra network activity and resource usage that they don’t want or need.
This spec will make it so explicit action is needed for the extension to be downloaded, and will also lazy load the extension if it’s already installed on first use.
Not part of this spec
Targeted Platforms
Description
Explicitly Installing Crypto Wallets
If the user does not have Crypto Wallets installed, but navigates to brave://wallet. They will get a first screen equivalent to the following popup which is built-in via web-ui and NOT part of the Crypto Wallets extension. It will no longer be a popup and will take up the whole screen under the red / purple gradient settings bar.
Re-opt in for Crypto Wallets if not setup
If a user has not setup Crypto Wallets yet, but the user does have the extension installed, then they will be considered as not installed, and it will show the above screen asking the user to Install. We will check if the user has setup Crypto Wallets based on if the wallet seed is stored in preferences already. These users will be considered as “not installed” in the sections below. I.e. they will need explicit opt-in for the extension to ever be loaded.
Changes to Dapp detection infobar
When a user visits a Dapp page, they are already presented with this infobar:
The behaviour of the Setup button will change. If the user clicks Setup, a new tab will open with brave://wallet and the infobar will disappear. The page will not reload anymore. This will not auto install the Crypto Wallets extension anymore.
For the equivalent infobar when MetaMask is installed, we’ll change “Use Crypto Wallets” to “Setup Crypto Wallets”. If the user clicks it, it will navigate to brave://wallet and will not auto install the Crypto Wallets extension anymore.
Startup behaviour
When the Crypto Wallets extension is installed, it will be by default lazily loaded henceforth. So on startup, Crypto Wallets will not be loaded.
The extension will be loaded in the following cases:
Settings
A new setting will be added under the existing Web3 provider for using Dapps setting called “Load Crypto Wallets on startup”. It will be defaulted to off.
QA Plan
Test cases 1:
Test cases 2:
Test case 3:
Test case 4:
Test case 5:
Test case 6: