0

When creating a site with MetaMask, you also want that other users who do not have MetaMask can use this site. To do this, you want to use the same library MetaMask uses - which is 0.20.3 currently.

I cannot find 0.20.3. I checked GitHub releases. Version 1.0.0-beta is up, and older versions do not hit 0.20.3

Where can I find this web3 version?

1 Answer 1

1

Metamask injects in the page web3 and you can use this one without including any web3 scripts in your page.

web3 = new Web3(web3.currentProvider);

You can check for metamask and alert message to the user if he donesn't have.

if (typeof web3 !== 'undefined') {
    web3 = new Web3(web3.currentProvider);
} else {
    alert('Please install metamask', 'Metamask!');
}
4
  • I have this already, thanks. However, I want that people who do NOT have MetaMask installed also being able to use web3. This means that they can VIEW data in a contract, but not interact with it since they have not connected an account.
    – JBrouwer
    Commented Mar 19, 2018 at 16:06
  • 1
    Ok then you can try with NPM. Type in terminal "npm install [email protected]" Commented Mar 19, 2018 at 16:12
  • Neat, that works!
    – JBrouwer
    Commented Mar 20, 2018 at 1:17
  • We want 1.0rc is it fine to use?
    – Eddie
    Commented Feb 12, 2019 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.