-
-
Notifications
You must be signed in to change notification settings - Fork 819
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
Ideas for automatically fetching files on the web #416
Comments
Related pyodide/pyodide#2987 |
@messense Thank you for the information. |
Ah it doesn't support Safari for now... https://github.com/pyodide/pyodide/blob/main/docs/usage/file-system.md |
In 1.8.12. I added a hook function for Emscripten file system so that Pyxel can get necessary files automatically. |
It is astonishing! |
Thank you for your comment.
I just searched for synchronous XMLHTTPRequest sample code which works, and
copied it.
https://github.com/kitao/pyxel/blob/main/wasm/pyxel.js#L292-L299
Regarding file system side, when I tried whether I can replace functions
under pyodide.FS, it worked.
So I wrapped open and stat functions to invoke XMLHTTPRequest when called.
https://github.com/kitao/pyxel/blob/main/wasm/pyxel.js#L319-L330
Best,
Takashi Kitao.
2022年10月6日(木) 17:34 Minsoo ***@***.***>:
… It is astonishing!
When I tried synchronous XMLRequest for hooks, the browser blocked it
since it is deprecated.
But your approach works!
I know this is a closed issue AND this is not much relevant to the pyxel,
but can you tell me how did you make it work?
—
Reply to this email directly, view it on GitHub
<#416 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFFXEWIRH5HDSGBQTFSVVTWB2FJVANCNFSM6AAAAAAQPBZJZI>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Thanks to Pyxel's new utility script, an html file for Pyxel is very simplified like this.
Another thing I would like to achieve is automatic fetching of files.
It seems that Emscripten can't mount real file system directly, but it may be realized virtually if I can insert some hook script for each load function in Pyxel.
With the feature, I would like shorten this script from
to
If anyone has the knowledge to implement this feature, I would appreciate any advice.
The text was updated successfully, but these errors were encountered: