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

website hard to test locally; it requires a webserver. (problem when using file URIs) #10

Open
SomberNight opened this issue Mar 31, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@SomberNight
Copy link
Member

The html files cannot be easily tested in a browser locally.
The website is broken when using the file:// protocol; it works when using http://,
so the workaround is to run a webserver locally.

Firefox (87.0) logs:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///.../electrum-web/panel-download.html. (Reason: CORS request not http).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///.../electrum-web/projects.json. (Reason: CORS request not http).

See https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs

@SomberNight SomberNight added the bug Something isn't working label Mar 31, 2021
@SomberNight
Copy link
Member Author

self-note: quick way to set up a webserver for local testing:

$ cd "$WWW_DIR"
$ python3 -m http.server --bind localhost 9995
$ firefox localhost:9995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant