Skip to content

Gracefully handle lack of localStorage #24

Description

@jbodner09

The Third-Party cookie blocking setting in browsers ends up blocking all forms of storage, not just cookies:
image

I suspect turning off all cookies would also do the same thing. When this happens, PuzzleJS hits an error during startup when trying to load previous state, which ends up preventing the entire puzzle from loading:
image

It should be easy to detect when localStorage is available via a try-catch block, and when it's not, alert the user that state won't be saved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions