Consider extending browsingData.RemovalOptions to allow removal by cookieStoreId
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: jkt, Unassigned)
References
Details
(Whiteboard: [browsingData][triaged])
Attachments
(1 obsolete file)
Reporter | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Updated•6 years ago
|
Comment hidden (advocacy) |
Comment 7•4 years ago
|
||
I have written experimental implementation of this that uses nsIClearDataService.deleteDataFromOriginAttributesPattern
. The means the user can't select which type of data (cookies, downloads etc.) is deleted. Instead it's just whatever this method deletes.
I think this could be used like browser.browsingData.remove({cookieStoreId: contextualIdentity}, {})
. The second empty object is important, it basically tells the user that they can't select what they are going to delete. But maybe instead of abusing this API like that we should just add a new method?
Comment 8•4 years ago
|
||
Comment 9•4 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #7)
I think this could be used like
browser.browsingData.remove({cookieStoreId: contextualIdentity}, {})
.
The second empty object is important, it basically tells the user that they can't select what they are going to delete.
Ordinarily, if the second value is an empty object, nothing would be deleted. The proposed semantics is the opposite of that, and may be confusing.
But maybe instead of abusing this API like that we should just add a new method?
This implementation/proposal appears to largely be guided by the current implementation details.
If implementation details weren't a concern, then a cookieStoreId
parameter to remove relevant data would be ideal.
Have you considered changing the internals to support deletion of data for a specific container tab? It looks like there is one (deprecated?) "clear-origin-attributes-data"
notification and a bunch of deleteByOriginAttributes
override that together are responsible for deleting all data: https://searchfox.org/mozilla-central/rev/165e8d8f80c02605c2f3e89c5de462abfce91c32/toolkit/components/cleardata/ClearDataService.jsm#1297-1327
Comment 10•4 years ago
|
||
Sadly it looks like deleteByOriginAttributes
is not implemented by a lot of the existing cleaners, that is why I didn't go that route initially.
Updated•4 years ago
|
Comment 11•4 years ago
•
|
||
Okay. I guess we can start implementing this for cookies and indexedDB at least. And maybe for localStorage when GenLocalStorage is enabled.
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Consider filing a new blocking bug with the implementation (if it is a very narrow subset), or a follow-up bug (dependent on this bug) if your patch offers almost all functionality. Makes it easier to track the completeness of this feature.
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Bug 1670811 just landed. browsingData.remove
now supports the option cookieStoreId
.
- This allows deleting default, private or container
cookies
. - Deleting default or container
indexedDB
data. - Deleting default or container
localStorage
data on Nightly. (Next-gen local storage is not enabled on release: bug 1599979)
Adding support for other data types is going to be more troublesome. It's going to require changes to nsIClearDataService
. I am probably not going to work on that in the foreseeable future.
Comment 14•4 years ago
|
||
The browsingData API docs and compatibility tables should be updated to mention this enhancement.
Some notes about the changes introduced are available in Tom's comment 13.
Comment 15•4 years ago
|
||
Let's move the dev-doc-needed to Bug 1670811.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•