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:
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,
Most helpful comment
see: https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#globe_with_meridians-https---web-server-required
I think its because of this.