Closed boldtrn closed 6 months ago
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
Unhandled Promise Rejection: SecurityError: The operation is insecure.
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.
try/catch for methods accessing localStorage.
latest main
No response
For reference, we had the same issue with Klaro: https://github.com/klaro-org/privacy-manager/issues/366
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