-
Notifications
You must be signed in to change notification settings - Fork 132
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
Adding offline support for playing games as a PWA #25
base: master
Are you sure you want to change the base?
Conversation
This is really cool!! thank you for working on this - I tested this on my iPhone and it totally works, pretty amazing! I have not yet had a chance to look into PWA support so this gives me a really good starting point - There are a few things I wanted to work on first before releasing PWA capabilities as I want to play around with the tech and see some of the possibilities related to -
Some of these will also require some plumbing and UX work in the in JavaScript code. The reason I like the query parameters is it makes it easier to develop on without constantly clearing cache, So if you have some ideas around this I'd definitely love to hear it. Yeah in terms if icons I'll probably have to find some assets that I can use for that. In the meantime folks can definitely use your repo if they want to do offline install, like I did :) thanks again! |
My pleasure! Kudos to you for making the project open source and allowing community contribution. I'm happy to help.
This can be done independently of it being a PWA. IndexedDB is a great choice (and is what https://skyemu.app/ uses) for an in-browser key/value store with generous storage limits - it's basically only limited by the available storage on the device:
I currently have the service worker configured to do network first for every single file, and only pull from the service worker cache if the network connection is disabled / i.e. there is no internet connection. So I wouldn't anticipate this really being a problem. Check out the
What would be the reason to disable it? It shouldn't interfere at all with regular functionality.
That makes sense, and it does guarantee that you always have the latest version. :) |
Thanks for the info!! Yeah in general I will need to look into it, don't yet know what the downsides of having a service worker are (there may be none) but I do like making it as configurable as I can to give the user choice. I will also need to see what are the effects on cloud saves as there is also an option to host a backend for that. If things are always coming from cache that may not work so would have to see. |
@brismuth I have a problem with the emulator. I found that for some reason Super Mario 64 crashes on the when it transitions to the file select. And Paper Mario 64 just does not start up the title screen. |
@BeezBumba I'm not the maintainer of N64Wasm – @nbarkhina is. I just opened this pull request to add offline support for playing games. If you're experiencing issues, you'll want to file a new separate issue, rather than comment on this one. |
It's running and fully functional here, on Github Pages: https://brismuth.github.io/N64Wasm/
Caveats:
Another benefit to this running as a PWA is that if iOS users save it to their home screen, Safari will not delete their save files after a period of disuse, which it will do if it is just running in the browser without being added to the home screen.