Bug 1881797 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We have multiple components doing user triggered data clearing, e.g. `SiteDataManager` and `Sanitizer.sys.mjs`. They all go through `nsIClearDataService`, but may end up passing different flags. To ensure that we always clear the same things for a data category presented to the user, we should add a flag that clears everything considered "cookies & site data" from a user perspective. This can be a flag similar to [CLEAR_FORGET_ABOUT_SITE](https://searchfox.org/mozilla-central/rev/da49863c3d6f34038d00f5ba701b9a2ad9cbadba/toolkit/components/cleardata/nsIClearDataService.idl#334) which combines other flags.

We could add a new flag `CLEAR_COOKIES_AND_SITE_DATA` which maps to `CLEAR_COOKIES | CLEAR_DOM_STORAGES | CLEAR_EME | CLEAR_STORAGE_PERMISSIONS | [...]`. Additionally we should add a flag e.g. `CLEAR_STORAGE_PERMISSIONS` that calls into a dedicated cleaner which clears the permissions with type “storage-access” and “persist-storage”.  `SiteDataManager` [clears these permissions](https://searchfox.org/mozilla-central/rev/a8cc31504a2379bcf8ba395d2da7bb632b5521d6/browser/modules/SiteDataManager.sys.mjs#509) when clearing site data, but our new clear recent history dialog (using `Sanitizer.sys.mjs`) [does not](https://searchfox.org/mozilla-central/rev/da49863c3d6f34038d00f5ba701b9a2ad9cbadba/browser/modules/Sanitizer.sys.mjs#907,920-926,932-938).
We have multiple components doing user triggered data clearing, e.g. `SiteDataManager` and `Sanitizer.sys.mjs`. They all go through `nsIClearDataService`, but may end up passing different flags. To ensure that we always clear the same things for a data category presented to the user, we should add a flag that clears everything considered "cookies & site data" from a user perspective. This can be a flag similar to [CLEAR_FORGET_ABOUT_SITE](https://searchfox.org/mozilla-central/rev/da49863c3d6f34038d00f5ba701b9a2ad9cbadba/toolkit/components/cleardata/nsIClearDataService.idl#334) which combines other flags.

We could add a new flag `CLEAR_COOKIES_AND_SITE_DATA` which maps to `CLEAR_COOKIES | CLEAR_DOM_STORAGES | CLEAR_EME | CLEAR_STORAGE_PERMISSIONS | [...]`. Additionally we should add a flag e.g. `CLEAR_STORAGE_PERMISSIONS` that calls into a dedicated cleaner which clears the permissions with type “storage-access” and “persist-storage”.  `SiteDataManager` [clears these permissions](https://searchfox.org/mozilla-central/rev/a8cc31504a2379bcf8ba395d2da7bb632b5521d6/browser/modules/SiteDataManager.sys.mjs#509) when clearing site data, but our new clear recent history dialog (using `Sanitizer.sys.mjs`) [does not](https://searchfox.org/mozilla-central/rev/da49863c3d6f34038d00f5ba701b9a2ad9cbadba/browser/modules/Sanitizer.sys.mjs#907,920-926,932-938).
Once we have a `CLEAR_STORAGE_PERMISSIONS` we can remove the code that clears these permissions in `SiteDataManager`.

Back to Bug 1881797 Comment 0