Closed Bug 2052960 Opened 1 month ago Closed 1 month ago

"Restore previous session" appends to the Smart Window new tab instead of overwriting it

Categories

(Core :: Machine Learning: Frontend, enhancement)

enhancement
Points:
1

Tracking

()

VERIFIED FIXED
155 Branch
Tracking Status
firefox154 --- wontfix
firefox155 --- verified

People

(Reporter: giulia, Assigned: giulia)

References

Details

(Whiteboard: [aife])

Attachments

(1 file)

When Smart Window is the user's default and you restore the previous session manually (History -> Restore Previous Session), the restored tabs open alongside the empty Smart Window new tab instead of replacing it. In a Classic window the restore correctly overwrites the initial new tab.

Steps to reproduce:

  1. Enable Smart Window and set it as the default (browser.smartwindow.enabled + browser.smartwindow.isDefaultWindow), signed in, with browser.startup.page = 1.
  2. Open a few tabs and quit.
  3. Start Firefox — it opens a Smart Window showing the new tab.
  4. History menu → "Restore previous session".

Expected: the restored session replaces the new tab (same as a Classic window).
Actual: the new tab is kept and the restored tabs open separately.

Root cause:
SessionStoreInternal._prepWindowToRestoreInto decides whether restore can overwrite the current tabs by checking each tab's URL against a list of "home pages" (about:blank + HomePage.get()):
https://searchfox.org/firefox-main/source/browser/components/sessionstore/SessionStore.sys.mjs (see _prepWindowToRestoreInto, the homePages / removableTabs logic)

A Smart Window's new tab is chrome://browser/content/aiwindow/aiWindow.html, which isn't in that list, so it's not treated as removable. As a result canOverwriteTabs stays false and the restore appends the previous session's tabs instead of overwriting the new tab. A Classic window's initial tab (about:home) is in the list, so it gets overwritten.

Attachment #9610305 - Attachment description: WIP: Bug 2052960: Add Smart window new tab as an overwrittable page on restore previous session → Bug 2052960: Add Smart window new tab as an overwrittable page on restore previous session
Pushed by gcardieri@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1189cacea8d4 https://hg.mozilla.org/integration/autoland/rev/e48087da534d Add Smart window new tab as an overwrittable page on restore previous session r=sthompson
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Duplicate of this bug: 2040324

Verified as fixed in our latest Nightly 155.0a1 (2026-08-10)

QA Whiteboard: [qa-ver-needed-c155/b154]
QA Contact: rdoghi

Updating the main status flag.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-ver-needed-c155/b154] → [qa-ver-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: