-
-
Notifications
You must be signed in to change notification settings - Fork 735
Add support for disabling local storage usage #2872
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
Add support for disabling local storage usage #2872
Conversation
if (!this.disableStorage) { | ||
storage.setItem(this.key, open.toString()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not a fan of how this option has propagated to every instance of saving something to storage. A better implementation would instead be to have the storage module perform the correct action based on whether the option was set or not, so this option doesn't leak into every instance of saving state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the approach, instead moving everything under the storage utility, making use of a noOpStorageImpl
to perform the actions when local storage is disabled.
Is there a source for this? As per my (limited) knowledge, cookie preferences privacy concerns are for user tracking, I'm not sure if saving component state comes under that. I'm also not sure if all websites must have a consent form or similar regardless of its use. |
Saving of component toggle state, and theme via local storage would fall under functional cookie requirements, further details for which can be found here. |
Thanks! I appreciate the minimal implementation |
Changes
Introduces ability to toggle usage of local storage from components and settings elements through
dataset
functionality of document similar to that of theme. UI checkbox added to settings menu that defaults to being hidden to allow for toggle of this feature via UI, otherwise accomplished through changes to thedocument.documentElement.dataset
attributes directly.Rationale Behind Changes:
Certain functional cookie requirements require that local storage not be used for legal compliance reasons. As such, having the ability to toggle the use of local storage for components based on users' cookie preferences is a priority.