Open Bug 1751045 Opened 4 years ago Updated 3 months ago

Support "Clear cookies and site data..." in private browsing mode

Categories

(Toolkit :: Data Sanitization, enhancement, P5)

Firefox 96
enhancement

Tracking

()

People

(Reporter: nathanielpalmer, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

  1. Open a site in a private window.
  2. From the site information menu select "Clear cookies and site data..."

Actual results:

The "Clear cookies and site data..." disappears and does not return even after a reload. This is despite the fact that new cookies have been set as can be confirmed by opening the Storage tab in dev tools.

Expected results:

The "Clear cookies and site data..." should always be available even in private windows even after previously clearing site data. This is especially useful for web devs who want to test a site with a clean slate without deleting their site data for non-private windows.

The Bugbug bot thinks this bug should belong to the 'Toolkit::Data Sanitization' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Data Sanitization
Product: Firefox → Toolkit
Flags: needinfo?(pbz)

Looks like the "Clear cookies and site data" button does not interact with private browsing mode at all. That means it clears normal browsing data, and is only shown if normal browsing has cookies set:
https://searchfox.org/mozilla-central/rev/072f9e6b7f10a00e12d0a02ac713431d0a7ee368/browser/base/content/browser-siteIdentity.js#925-928

Tim, do you think we could support data clearing via this button for PBM windows? From some testing it looks like we don't touch PBM localStorage when the button is used in a PBM window.
Though this code path uses deleteDataFromBaseDomain which is supposed to clear across OriginAttributes, including privateBrowsingId:
https://searchfox.org/mozilla-central/rev/072f9e6b7f10a00e12d0a02ac713431d0a7ee368/toolkit/components/cleardata/nsIClearDataService.idl#59

If we can't / don't want to support it, we should probably hide the button in PBM (both normal PBM and permanent PBM).

Flags: needinfo?(pbz) → needinfo?(tihuang)

I think it's reasonable to support the Clear cookies and site data button in PBM because users might have a need to clear site data within the PBM browsing session for either testing purposes or other individual privacy concerns. But I am not sure if we want to touch the normal browsing data when people click this button in PBM.

I think it's clear to our users that PBM is using a separate cookie jar, and many people use PBM for this purpose, so maybe this button should only clear data for PBM if it was clicked in PBM. And the text might also need to be adjusted to something like Clear cookies and site data for Private Browsing Mode.

Flags: needinfo?(tihuang)

The severity field is not set for this bug.
:pbz, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(pbz)

Let's split this bug up. I'll leave this one open for properly supporting the feature in PBM. I don't want to prioritize this at the moment, given that private browsing sessions are ephemeral anyway. But I can see that there is a use case for it, so I'd accept a patch.
For now, since it clears normal browsing data, we should hide the button in PBM to not mislead users. Filing a separate bug for that.

Severity: -- → N/A
Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true
Flags: needinfo?(pbz)
Priority: -- → P5
Summary: "Clear cookies and site data..." option disappears in private window → Support "Clear cookies and site data..." in private browsing mode
See Also: → 1754172
See Also: → 1773288
Duplicate of this bug: 1875048

Some info from Emma about this:

We currently don't support clearing PBM data, that's why we've also made the recent change to hide the option in private browsing.
Now that most of the relevant cleaners in ClearDataService support clearing by (schemeless) site + OriginAttributesPattern it should be feasible to support clearing only PBM data for a given site. E.g. you could pass example.com, { privateBrowsingId: 1 } to nsIClearDataService. Before we enable this we should verify that the cleaners properly clear PBM data though.
deleteDataFromSite: https://searchfox.org/mozilla-central/rev/4c065f1df299065c305fb48b36cdae571a43d97c/toolkit/components/cleardata/nsIClearDataService.idl#57-85
I think I've seen a similar bug before. This is probably a duplicate.

Duplicate of this bug: 1965247
Duplicate of this bug: 1992645
No longer duplicate of this bug: 1992645
You need to log in before you can comment on or make changes to this bug.