-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace localStorage
with a mock API which doesn't create permanent state
#5935
Comments
@rebron we don't mock the API currently, we report storage blocked (which is a case web devs should handle, but don't). It would be a neat / fine idea to mock the API instead of blocking though. @jumde @fmarier @diracdeltas wdyt? |
Aside from checking whether or not storage is blocked, sites are likely to also check if they can read back what they just put in local storage. Maybe we should stash any such data into an in-memory data structure that gets cleared once the page is navigated away? That would be similar to Safari's approach of accepting everything and then cleaning up later, except that "later" would be sooner than Safari which typically waits for at least 24 hours before clearing anything. |
yea, was discussing with @jumde . Maybe the best way forward would be the following?
|
Any plans on implementing this? I'd love to be able to disable cookies across the board without breaking websites that use Web Storage. In the meantime, maybe Web Storage could be a separate shield toggle from the cookies toggle? |
@darrylyeo Can you talk more about your use case? For example, if you were to disable cookies across the board, how would you log into websites? I personally use uMatrix to block cookies by default and then whitelist sites I want to log into. |
@fmarier I'm using two separate browser profiles - one for general browsing where I turn on every Brave shield and privacy feature available to their most extreme settings, and a second profile with cookies allowed for sites that I need to log into. For the first profile, I have the default cookies shield set to "Cookies blocked", but currently I have to manually set it to "Cross-site cookies blocked" for some sites that break because of the Web Storage issue described. |
localStorage
with a mock API which doesn't create permanent state
Closed in favor of #8514, which includes this functionality |
With cookies disabled, visiting websites that use
window.localStorage
and similar APIs throws an error sometimes completely breaking existing websites.Consider replacing localStorage etc with a mock API that stores no data and allow rest of the js code to run normally.
The text was updated successfully, but these errors were encountered: