I have seen the announcement about the privacy changes that Meta Mask has made about no longer injecting Web3. And the article post they made gave a snip of code to include to request Web3 to be injected. If I am testing a dapp locally using Ganache do I need to add anything to that script to make sure that Web3 points to my local blockchain? I am hitting a bit of a road block here.

The code that I am referencing is in this link.


1 Answer 1


Currently the privacy feature is opt-in and you have to go into your Metamask settings and enable the requirement. If you don't enable it when you're testing locally, then no, you don't need to add the snippet, but you should really add the snippet when you go to deploy a dapp since any number of users have likely already enabled the privacy feature, and I hope that eventually, when most dapps have updated for the privacy mode, that Metamask will have make it an opt-out instead of opt-in feature. Privacy by default should be the standard, not the other way around.

  • Thanks @flygoing. This is great. I thought it was something a user needed to be prompted. That fixed my issue. I very much appreciate your help.
    – Pat Doyle
    Nov 16, 2018 at 18:46

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.