Closed Bug 2084383 Opened 1 month ago Closed 28 days ago

Pinned tabs are lost when the fire button deletes browsing data

Categories

(Toolkit :: Data Sanitization, defect)

defect

Tracking

()

RESOLVED FIXED
161 Branch
Accessibility Severity s3
Tracking Status
firefox161 --- fixed

People

(Reporter: jleritte, Assigned: jleritte)

References

Details

Attachments

(1 external file)

When the fire button (behind browser.fireButton.enabled, added in bug 2076799) deletes browsing history, every pinned tab is gone afterwards. Pinned tabs should persist.

Steps to reproduce:

  1. Set browser.fireButton.enabled to true and restart.
  2. Pin one or more tabs, optionally in more than one window.
  3. Click the fire button and choose "Delete all", or open the dialog with "Choose…" (or the direct flow) and delete with "Browsing and downloads history" checked.

Expected: the fresh window has the pinned tabs.
Actual: the fresh window has only a new tab; the pinned tabs are gone.

When history is deleted, the fire button adds openWindows to the items to clear, and that cleaner in browser/modules/Sanitizer.sys.mjs closes every browser window and opens one new window, so the pinned tabs close with their windows. When history isn't deleted, windows stay open and pinned tabs already survive.

Expected behavior:

  • Only for the fire button; the Forget button keeps its current behavior.
  • The fresh window gets the pinned tabs of every closed window, in window order.
  • Each comes back on its current address only, without its back/forward history.
  • They are restored unloaded and load when selected, so nothing loads (and sets cookies or history) while the data is being deleted.

The fire button experiment targets Firefox 161 (merge to Beta on 2026-11-05).

The openWindows cleaner in Sanitizer.sys.mjs opens one defaultArgs window and closes every browser window, and it carries nothing across. Both fire button paths reach it: clearSession() in CustomizableWidgets.sys.mjs, and the dialog's sanitize() in sanitizeDialog.js, which adds openWindows when _closeWindowsWithHistory is set. Only the fire button sets that flag.

Fix: Add a boolean sanitize option such as keepPinnedTabs, passed from clearSession() and from the dialog when _closeWindowsWithHistory is set, so the Forget button is unchanged. When the option is on, openWindows.clear collects the URL, label and userContextId of each pinned tab in every non-private window after the _canCloseWindow loop and before the close loop, reading the URL from SessionStore.getTabState for pending tabs. In onWindowOpened it then re-adds them with gBrowser.addTrustedTab(url, { pinned: true, createLazyBrowser: true, lazyTabTitle, userContextId }). Don't restore them through SessionStore: browser.sessionstore.restore_pinned_tabs_on_demand is false, so it would load pinned tabs during the clear. Coverage today is browser_fireButton.js and testCloseWindowsWithHistory in browser_sanitizeDialog_v2.js, which stub Sanitizer.sanitize, so they can assert the option but not the restored tabs.

Suggested severity: S3. Users in the fire button experiment lose their pinned tabs on every history-clearing use, but it is a pref-gated experiment, the user asked for a full clear, and re-pinning is a workaround.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

Accessibility Severity: --- → s3

When the fire button deletes history, it closes every window and opens a new one, so the pinned tabs were lost. The openWindows cleaner gets a keepPinnedTabs option, which the fire button passes from both its panel and its dialog. The new window gets the pinned tabs of the non-private windows, in window order, on their current address only. They stay unloaded until selected, so that they don't load anything while the rest of the data is being deleted. The Forget button is unchanged.

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

For more information, please visit BugBot documentation.

Flags: needinfo?(momar)
Pushed by jleritte@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b1c59d105b80 https://hg.mozilla.org/integration/autoland/rev/1d9195dc7ff3 Keep the pinned tabs when the fire button closes the windows to delete browsing data. r=manuel,nsharpley
Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
Severity: -- → S3
Flags: needinfo?(momar)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: