electrum-web
electrum-web copied to clipboard
website hard to test locally; it requires a webserver. (problem when using file URIs)
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
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