MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.94k stars 4.88k forks source link

web3.eth.coinbase is still null when metamask is re-logged in. #6030

Closed huyhoangk50 closed 5 years ago

huyhoangk50 commented 5 years ago

Describe the bug web3.eth.coinbase is still null when metamask is re-logged in.

To Reproduce Steps to reproduce the behavior:

  1. Login to metamask
  2. Go to console in browser
  3. Type console.log(window.web3.eth.coinbase); //return correct coinbase
  4. Log out metamask
  5. Type console.log(window.web3.eth.coinbase); //return null
  6. Login to metamask
  7. Type console.log(window.web3.eth.coinbase); //still return null

Browser details (please complete the following information):

EtDu commented 5 years ago

Reproduced, V6.3.0 in Chrome. Same behavior with web3.eth.accounts, returns an empty array. Investigating now

tmashuang commented 5 years ago

@ContemporaryAnarchy Check your Privacy Mode setting in MetaMask, Settings -> Security & Privacy as of v6.3.0 first time users will have the setting on my default, which with return null until the Dapp requests access.

EtDu commented 5 years ago

Hey tmas! This issue persists regardless of privacy mode setting. @kumavis discovered is was the contentscript manually setting the selectedAddress to 'undefined'. I believe this is being fixed in this PR https://github.com/MetaMask/metamask-extension/pull/6410

yogeshbangar commented 5 years ago

Follow the step to reconnecting host on chrome Metamask plugin

connection

parth-5097 commented 4 years ago

I recently solved this issue by downgrading metamask to version 6.7. So, you should try.

harry91198 commented 4 years ago

Follow the step to reconnecting host on chrome Metamask plugin

connection

This worked for me, thanks

Follow the step to reconnecting host on chrome Metamask plugin

connection

andrehadianto commented 4 years ago

Follow the step to reconnecting host on chrome Metamask plugin

connection

this works for me too! thanks

benmotyka commented 3 years ago

In late 2020 there is no longer a option to add it from the metamask level, you need to enter localhost and then do the following:

image

After this there should be a "Manually connect to current site". Proceed, and it should work just fine.