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 upCan't detect new built-in "crypto wallets" extension of brave browser in javascript #7166
Projects
Comments
|
@bsclifton why do you label that as "feature". It is clearly a bug imo. We also tested it with a lot of dapps and it breaks every single one of them. |
|
@ppeinsold The label is for internal use to triage the issues relating to Crypto Wallets. I have added the appropriate labels |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In javascript there is no "window.ethereum" or "window.web3" available if only crypto wallets is enabled and metamask is not installed. Do you maybe inject a different variable? As long as the MetaMask extension is installed the window.ethereum property is existing and otherwise not. I've also checked if the native wallet of Brave and its API is documented somewhere but I sadly couldn't find any documentation about it.
Steps to Reproduce
Let me add a little bit of a code example. The following code is to connect to web3 browser using web3js library:
Actual result:
This works fine for all browsers but in brave it crashes when "crypto wallets" is enabled. The problem here is, that a check is missing. On the line where I have " console.error("Unable to connect to metamask");" I need to detect "crypto wallets" because I end up here if only "crypto wallets" is installed and metamask is not. Does anyone know how to make this check?
Expected result:
We can detect built-in "crypto wallets"-extension of brave browser with an injected variable.
Reproduces how often:
Easily reproduced
Brave version (brave://version info)
newest brave version