Skip to content

localStorage usage in unsupported environments #166

Description

@WarningImHack3r

Describe the bug

In environments where localStorage is not available (most notably when users disable browser storage altogether), using it throws a SecurityError.

Such exceptions are not handled/caught by mode-watcher, the first hit being the inlined setInitialMode function.

Reproduction

Any usage of the lib within a site when the browser setting about persistent storage is disabled

Logs

Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

System Info

N/A

Severity

annoyance

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions