You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Instead of blindly using the local storage in CachedJSONData, it should be verified that its indeed available.
If its not available, then the data should be loaded to the memory.
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. :)
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?
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
The text was updated successfully, but these errors were encountered: