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

[Bug]: using LocalStorage if Browser rejects storing local data #609

Closed
boldtrn opened this issue Dec 18, 2023 · 1 comment
Closed

[Bug]: using LocalStorage if Browser rejects storing local data #609

boldtrn opened this issue Dec 18, 2023 · 1 comment
Labels
bug:confirmed bug Something isn't working
Milestone

Comments

@boldtrn
Copy link

boldtrn commented Dec 18, 2023

Expected Behavior

One issue with localStorage always happens if browser are set up to not allow storing any local data.

Calling any localStorage methods throws a SecurityError.

No exception is thrown, when the browser is configured to not allow storing data.

See also: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage#exceptions

Current Behavior

Unhandled Promise Rejection: SecurityError: The operation is insecure.

Steps to reproduce

Don't allow any data to be stored, load the library, the Error is thrown on library load as the localStorage is called to see if any consent is stored.

Proposed fix or additional info.

try/catch for methods accessing localStorage.

Version

latest main

On which browser do you see the issue?

No response

@boldtrn boldtrn added the bug Something isn't working label Dec 18, 2023
@github-actions github-actions bot added the triage yet to be reviewed label Dec 18, 2023
@boldtrn
Copy link
Author

boldtrn commented Dec 18, 2023

For reference, we had the same issue with Klaro: klaro-org/klaro-js#366

@orestbida orestbida removed the triage yet to be reviewed label Dec 18, 2023
@orestbida orestbida added this to the v3.0.0 milestone Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants