Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Muhammad-Altabba opened this issue Feb 14, 2019 · 2 comments

Comments

@Muhammad-Altabba
Copy link

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
@jamesmorgan
Copy link

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.

@Muhammad-Altabba
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants