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

Compatibility: In case local storage is disabled or unavailable #2

Open
goobemaster opened this issue Jan 29, 2022 · 0 comments
Open
Assignees

Comments

@goobemaster
Copy link
Owner

This has been bugging me for the last few days. In theory local storage is widespread now in modern browsers. But what is the guarantee that its enabled, available or otherwise readily usable?

  1. Instead of blindly using the local storage in CachedJSONData, it should be verified that its indeed available.
  2. If its not available, then the data should be loaded to the memory.
  3. If its not available, then persistent user data (e.g. score, level) should be saved to a cookie.

Now, cookies are deemed to be the enemy these days, so another fallback may be needed, like:

Informing the user that all attempts failed to persistently save their data, so pretty please enable the local storage or cookies - otherwise they need to start the game from level 1 every time. :)

https://caniuse.com/namevalue-storage

@goobemaster goobemaster self-assigned this Mar 31, 2022
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

No branches or pull requests

1 participant