Skip to content

Gracefully handle lack of localStorage #24

@jbodner09

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.

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