Metamask-extension: Not sure why `window.ethereum` is not injected in html files opened locally (directly from os files without a web server).

Created on 14 Feb 2019  路  2Comments  路  Source: MetaMask/metamask-extension

Describe the bug
Not sure why window.ethereum is not injected in html files opened locally (directly from os files without a web server).

Is this intended for security reason? Or is this a bug?

To Reproduce
Steps to reproduce the behavior:

If I open an HTML page from my OS (by double click on it), ethereum is undefined. I also tried this by both: writing javascript blocks inside the HTML page, and from browser console.

Expected behavior
ethereum is defined in both ways: if the page is opened locally, or hosted on a web server.

Browser details:

  • OS: Both Windows 10 and Ubuntu 18
  • Browser: Chrome
  • MetaMask: Version 6.0.1

Most helpful comment

see: https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#globe_with_meridians-https---web-server-required

Due to browser security restrictions, we can't communicate with dapps running on file://. Please use a local server for development.

I think its because of this.

All 2 comments

see: https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#globe_with_meridians-https---web-server-required

Due to browser security restrictions, we can't communicate with dapps running on file://. Please use a local server for development.

I think its because of this.

So it is because of browser security restrictions.
Many thanks,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

estebanmino picture estebanmino  路  3Comments

danfinlay picture danfinlay  路  3Comments

BMillman19 picture BMillman19  路  3Comments

kumavis picture kumavis  路  3Comments

DISC30 picture DISC30  路  3Comments