Skip to content
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

Make WASM use IndexedDB for data persistence #1869

Merged
merged 1 commit into from
Nov 6, 2021

Conversation

Semphriss
Copy link
Member

This PR makes WASM builds use IndexedDB in browsers, which allows much larger files to be stored. It also uses data persistence, which prevents browsers from automatically deleting progress without warning.

Custom levels done in the browser will now be saved, and the warning prompting users to download their levels will only show if data persistence has been denied.


NOTE: Data persistence requires special permission from the browser. While searching, I found that although Firefox does this normally and asks users if they want data to persist, Chrome and Chromium-based browsers (Edge, Opera, Brave, etc.) decide by themselves which websites they consider important, and will never prompt the user to ask for preference.

Since users using those browsers will never be able to choose if they want their data saved or not, I added a prompt to users of those browsers directing them to use Firefox as a solution.

Info can be found here: https://web.dev/persistent-storage/#how-is-permission-granted

@tobbi tobbi merged commit dddec70 into SuperTux:master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants