EatTheBlocks Forum

Problem with injecting web3 in Firefox

Hello everyone,

I am working on a well known app called pet shop and I have a problem with it.
Web3 is not getting injected in Firefox and therefore Metamask displays “not connected”.
I make my DAPP working on Ganache.

Does someone know how I could inject web3 in Firefox?

Thank you for your help

Take care

Pierre

Sorry for the late answer Pierre. What do you see when you run console.log(window.ethereum) ?

Hi Julian,

Thank you for your answer.
When I type console.log(window.ethereum) in firefox I get this:
image

Thank you

Pierre

Can you post a screenshot of this ‘not connected’ message?

By the way, make sure to use Chrome, not Firefox, when developing with Metamask.

Hello Julian,

Here is the screenshot:

I use the command “npm run dev” in order to launch the web browser.

Thank you

Pierre

Not connected does not mean you are not connected to the Blockchain, it means the user has not allowed the Dapp to access his/her address.

You need to call await window.ethereum.enable() in the Javascript code of your Dapp, and Metamask will show connected.