5 ms·
If you just open an HTML file in your browser via its local path (e.g. /home/user/...) the browser will prevent you from loading other files by JS due to CORS.
by rthz 5y ago
If you just open an HTML file in your browser via its local path (e.g. /home/user/...) the browser will prevent you from loading other files by JS due to CORS. So we need a web-server to set the appropriate CORS headers. Any web-server would do.
For inline code, yes it would be doable someone would need to continue https://github.com/pyodide/pyodide/pull/692 https://github.com/pyodide/pyodide/pull/692
For examples, I'll respond in the Pyodide issue where you commented.
- deleted 5y ago[deleted]
- jokoon 5y agoAny other way to agree with CORS without a webserver? What about embedding some js code, or moving the WASM files locally? Thanks for the answers. Cheers and good luck for this project, I can't wait for it to progress!
- rthz 5y agoYou can work around it by embedding data into HTML files but it's really not recommended https://github.com/pyodide/pyodide/pull/606 https://github.com/pyodide/pyodide/pull/606