-
I want to run Pyodide in an iOS offline environment. After some trial and error, I found that I could call wasm from XMLHttpRequest.
Is there any other good way? Here is the code used for the evaluation. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Normally browsers will not allow loading .wasm files from local paths see FAQ. I see you have
but I'm not sure if that is enough to bypass this restriction. In your case, I would start with launching a local HTTP server to serve Pyodide assets to make sure that works with WKWebView and Swift. Then once this works, try to get rid of the HTTP server to load files directly from local URLs, but I'm not sure that this would be technically possible. |
Beta Was this translation helpful? Give feedback.
-
This one solved the problem for me: |
Beta Was this translation helpful? Give feedback.
Normally browsers will not allow loading .wasm files from local paths see FAQ. I see you have
but I'm not sure if that is enough to bypass this restriction.
In your case, I would start with launching a local HTTP server to serve Pyodide assets to make sure that works with WKWebView and Swift. Then once this works, try to get rid of the HTTP server to load files directly from local URLs, but I'm not sure that this would be technically possible.