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

Testing for localStorage breaks compatibility with older browsers #556

Closed
bazzanintelliact opened this issue Sep 6, 2024 · 2 comments · Fixed by #558
Closed

Testing for localStorage breaks compatibility with older browsers #556

bazzanintelliact opened this issue Sep 6, 2024 · 2 comments · Fixed by #558

Comments

@bazzanintelliact
Copy link

After upgrading to search-insights v2.16.3, we started seeing issues for users on older iOS and Android versions.
This only seems to be the case if Cookies are disabled or when using Incognito/Private browsing.

When trying to access localStorage following exception is thrown
SecurityError: The operation is insecure.

This is the line causing the issue:

static store: Storage | undefined = globalThis.localStorage;

Wrapping the access to localStorage in a try/catch seems to fix the problem

@JasonBerry
Copy link
Collaborator

This issue is resolved in 2.17.2.

Thank you for reporting it!

@bazzanintelliact
Copy link
Author

@JasonBerry Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants