Localstorage Support
See original GitHub issueFollow up issues for IndexDB and other types of storage when we get there.
Future Solutions
Proper API for deleting Localstorage by hostname (both of these bugs seem to want to extend the browsingData API)
Pros
- Clear localstorage by site rather than all or nothing
- Should be easily added to the extension code since it seems like the extended API uses a list of hostnames which Cookie Cleanup conveniently returns
Cons
- No support yet
- Unless there’s a way to enumerate all localstorage, there’s a way for this extension to miss some localstorage
- Ex. A site that uses no cookies and only localstorage (as cookie cleanup outputs site names for cookies that have been deleted to be sent into the localstorage cleanup)
- I find this very unlikely since almost all sites have cookies
- Ex. A current Cookie AutoDelete user who upgrades to a version that supports deleting localstorage will have their existing localstorage still there
- The user would have to clear all their localstorage after upgrade to get a “clean slate”
- Ex. A site that uses no cookies and only localstorage (as cookie cleanup outputs site names for cookies that have been deleted to be sent into the localstorage cleanup)
Firefox Blockers
Chrome Blockers
Current solutions
browsingData API
Pros
- Actual API for removing localstorage
Cons
- Not viable without the above bugs
- Current removalOptions only include the timeframe
Firefox Blockers
Inject a content script that clears localstorage on page load (courtesy of reddit)
Code:
window.localStorage.clear();
window.sessionStorage.clear();
Pros
- Works in all browsers
- Better than the current browsingData API
- Will work with the whitelists
Cons
- Seems very hackish and its only a workaround
- Localstorage stays until the user visits the website again
- Probably have to come up with an algorithm to find the diff of the current tabs (between page loads) and only inject if there is a change (otherwise the injection would happen every time on site navigation)
- Because of this, this workaround will be on the backburner until I have some strategies about the best way to only inject the content script when it is needed
I’m thinking of doing the content script route as an experimental feature until the browsingData gets extended. Anyone else is free to give their input on how best to implement this.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:21
- Comments:98 (18 by maintainers)
Top Results From Across the Web
Window.localStorage - Web APIs | MDN
The localStorage read-only property of the window interface allows you to access a Storage object for the Document's origin; the stored data ...
Read more >"localstorage" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >HTML Web Storage API - W3Schools
Before using web storage, check browser support for localStorage and sessionStorage: ... The localStorage object stores the data with no expiration date.
Read more >LocalStorage, sessionStorage - The Modern JavaScript Tutorial
Web storage objects localStorage and sessionStorage allow to save key/value pairs in the browser. What's interesting about them is that the ...
Read more >localStorage in JavaScript: A complete guide - LogRocket Blog
localStorage browser support ... localStorage as a type of web storage is an HTML5 specification. It is supported by major browsers including IE8....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I implemented a basic implementation of localstorage cleaning.
Here are some things I noticed:
Citing it here for convenience. Excerpt from https://blog.mozilla.org/addons/2017/11/20/extensions-in-firefox-58/: