Commit Graph

220 Commits

Author SHA1 Message Date
Dão Gottwald
e0a00e5f7d Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-20 12:06:21 +00:00
Sandor Molnar
32b4815cfe Revert "Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker" for causing remote failures @ browser_TabManager.js
This reverts commit 38a0034022.
2025-05-19 21:07:58 +00:00
Dão Gottwald
38a0034022 Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-19 19:48:54 +00:00
DJ
4c6277efaf Bug 1957488 - record reopen event when reopening a deleted tab group. r=sthompson,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D248250
2025-05-09 15:00:22 +00:00
Sam Foster
3bc128efc2 Bug 1905958 - Add a JSON schema for browser session state and a way to validate against it. r=sessionstore-reviewers,sidebar-reviewers,nsharpley,dwalker
- Add the schema itself with definitions for the various data structures the serialized browser
  session state contains
- Add means of validating the current state against the schema with a new SessionStore.vaidateState
  method
- Add a smoke test to the schema by validating against sample session restore document
- Fix an issue in SidebaState which was returning undefined for some property values which isn't valid JSON

Differential Revision: https://phabricator.services.mozilla.com/D246163
2025-05-01 15:21:00 +00:00
John McCann
925d4f422f Bug 1952307 - Use hasAttribute instead of getAttribute in restoreWindowFeatures r=Erchen,sessionstore-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246052
2025-04-28 19:52:13 +00:00
Stephen Thompson
f8fe0335c0 Bug 1938401 - tab group interaction metrics r=dwalker,sessionstore-reviewers,tabbrowser-reviewers
Records counts of user interactions with tab groups:

- expand a collapsed tab group
- collapse an expanded tab group
- rename a tab group
- change a tab group's color
- save and close a tab group
- delete a tab group
- reopen a deleted tab group
- ungroup a tab group
- move a tab group to a new window
- reopen a saved and closed tab group from the list all tabs menu
- reopen a saved and closed tab group from a URL bar suggestion
- reopen a recently closed tab group from the recently closed tabs menu

Differential Revision: https://phabricator.services.mozilla.com/D246123
2025-04-24 02:20:14 +00:00
apostrophest
6033809e9c Bug 1956254 - fix saved tab group behavior on session restore r=dwalker,sessionstore-reviewers
Current behavior on Windows: if you close a window that has open tab groups, the tab groups are automatically saved. Opening Firefox into the initial deferred restore state properly shows the tab groups as saved. However, after restoring the previous session manually, the tab groups exist both in the tab strip (correct) and in the list of saved tab groups (incorrect).

Bug 1950611 and bug 1954488 dealt with several edge cases around saved groups + session restore. In Windows, it looks like on session startup, `_prepDataForDeferredRestore` receives a state where the open tab groups from last session are stored in both `savedGroups` and `windows[].groups[]`. `_prepDataForDeferredRestore` has logic to convert the open tab groups in `windows[].groups[]` into saved groups, but it'll skip any that are already present in the list of saved groups. This was fine until the fix for bug 1954488, which unsets `removeAfterRestore` from the saved group; the `windows[].groups[]` groups get the `removeAfterRestore` flag set, but that does not get put into `savedGroups` because the group already exists in `savedGroups`.

I amended the logic so that when a group is in `windows[].groups[]` and `savedGroups`, the tab group state from `savedGroups` will get `removeAfterRestore` set back to true.

Not totally sure why I could reproduce this on Windows but not on macOS. It looks like the saved groups in `defaultState.savedGroups` still have `removeAfterRestore: true` set even after the `delete group.removeAfterRestore`. I don't understand how that would happen.

Differential Revision: https://phabricator.services.mozilla.com/D246377
2025-04-24 01:44:21 +00:00
Eric Chen
39a7352079 Bug 1959812 - Defer session restore when Firefox is launched via a taskbar tab window r=sfoster,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245484
2025-04-17 15:46:29 +00:00
Stephen Thompson
8551cfa4aa Bug 1938398 - add saved tab group metrics r=jswinarton,sessionstore-reviewers,tabbrowser-reviewers
- record number of saved tab groups
- record min/max/median/average number of tabs in saved tab groups

This patch adds a new observable topic `sessionstore-saved-tab-groups-changed` to SessionStore. This is emitted when a saved tab group is added or removed from the session. BrowserUsageTelemetry subscribes to that topic and updates saved tab group-related metrics.

BrowserUsageTelemetry is also setting those saved tab group-related metrics on startup. BrowserGlue initializes BrowserUsageTelemetry after the session has been restored/set up, so saved tab group information will be available at that time. This is also important to make sure that we keep this metric correct even if a user doesn't touch their saved tab groups during the course of a session.

Differential Revision: https://phabricator.services.mozilla.com/D245138
2025-04-14 16:01:39 +00:00
Stephen Thompson
f2e07044ae Bug 1938424 - metrics event when tabs added to tab group r=dao,jswinarton,tabbrowser-reviewers,extension-reviewers,robwu
When using the tab context menu or drag-dropping tabs to put them into a group, record a metric for the number of tabs added to the group.

Data Science asked us to launch with this metric disabled so that they could control it using server knobs. They expect a high volume of events, so they expect to only enable this metric for some proportion of users.

I converted the existing `TabMove` event derived from `UIEvent` being fired when tabs change their tab index in the tab strip. `UIEvent` doesn't allow for attaching additional context/detail to the event. `TabMove` is now a `CustomEvent` that provides more context about the moved tab and it fires in more cases -- it's possible for the tab index not to change despite the tab having "moved" into/out of a tab group.

This approach would not capture tab movements that occur across multiple frames/event loop iterations.

Differential Revision: https://phabricator.services.mozilla.com/D244616
2025-04-11 13:52:22 +00:00
DJ
91384c4388 Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-10 17:35:20 +00:00
Butkovits Atila
b9dc6231d7 Backed out changeset 4711e76ce475 (bug 1938425) for causing failures at browser_tab_groups_telemetry.js. CLOSED TREE 2025-04-10 09:35:44 +03:00
DJ
cdc29e0d0d Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-10 03:02:30 +00:00
Eric Chen
81fd252f84 Bug 1915738 - Part 1: end session when all non-taskbartab Firefox windows are closed and prepare for restore r=sfoster,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241499
2025-04-09 18:57:25 +00:00
Cristina Horotan
2d08511dac Backed out changeset 7fed35bbd242 (bug 1938425) for causing bc failures at browser_tab_groups_telemetry.js. CLOSED TREE 2025-04-09 13:06:03 +03:00
DJ
e9f93720b5 Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-09 03:07:19 +00:00
smolnar
8c01d285cf Backed out changeset 1c700c5b8a89 (bug 1938425) for causing bc failures @ browser_tab_groups_telemetry.js CLOSED TREE 2025-04-07 19:45:55 +03:00
DJ
b8f461ce7f Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-07 14:51:17 +00:00
Jens Stutte
3b58b8ac47 Bug 1955534 - Do not use AsyncShutdown.quitApplicationGranted in SessionStore. r=sessionstore-reviewers,dwalker
SessionStore wants to flush the window and tab status early enough to not be disturbed by things going down, that is in response to "quit-application-granted".
Previously we used the AsyncShutdown blocker quitApplicationGranted here, but that is deprecated as it's not a "real" shutdown phase and caused a loot of confusion elsewhere.
Given we already had our own timer to actually avoid the crash from AsyncShutdown, there is no point in using AsyncShutdown and we can just spin the event loop by ourselves here.

Differential Revision: https://phabricator.services.mozilla.com/D242658
2025-04-04 09:42:46 +00:00
Dão Gottwald
3ba48b6655 Bug 1950904 - Use element index instead of tab index for the drop indicator. r=dwalker,jswinarton,tabbrowser-reviewers,perftest-reviewers,fbilt
Differential Revision: https://phabricator.services.mozilla.com/D239937
2025-03-19 15:07:53 +00:00
Jeremy Swinarton
92c3e82bc9 Bug 1954488: Delete removeAfterRestore property from savedGroups if the session is being quit for the second time r=dwalker,sthompson,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241978
2025-03-18 20:48:58 +00:00
DJ
dcb7322bc1 Bug 1954603 - prevent error in initSession when initializing a windowless session. r=sthompson,jswinarton,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241886
2025-03-18 17:32:53 +00:00
Greg Stoll
52693f9877 Bug 1926973 - make only explicitly unloaded tabs have a grayscale dimmed favicon r=desktop-theme-reviewers,tabbrowser-reviewers,dao,sessionstore-reviewers
This is what UX has decided makes sense, and will be much less disruptive
than dimming out all favicons on session restore. When we're ready the
default value of "browser.tabs.fadeOutExplicitlyUnloadedTabs" will be
true, and the default value of "browser.tabs.fadeOutUnloadedTabs" will
remain false.

Differential Revision: https://phabricator.services.mozilla.com/D241481
2025-03-15 00:30:28 +00:00
DJ
fb605dda4c Bug 1950611 - fix save and restore of groups when they trigger window closing. r=sthompson,jswinarton,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241490
2025-03-14 14:18:20 +00:00
Jeremy Swinarton
80b8a844b4 Bug 1951319: Deferred session restore re-opens tab groups r=dao,sthompson,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241012
2025-03-12 17:46:04 +00:00
Stephen Thompson
a4e5d1a634 Bug 1952902 - closed tab groups and saved tab groups should retain all tabs r=dao,sessionstore-reviewers
When closing single or multiple tabs, session state has historically capped the number of closed tabs being tracked. The main motivation was to prevent session file sizes on disk from getting too large.

When we introduced tab groups to session state, we avoided those caps when the tab group itself is being closed/saved. Users think of tab groups as whole entities. We were successfully saving tab groups with any number of tabs.

I introduced a regression causing closed tab groups and saved-and-closed tab groups to have their tab lists in session state capped. This patch resolves the regression by bypassing the cap when a closing tab is being closed as part of a tab group closing as a whole. Single or multiple tabs that are closed directly by the user should still be capped even if those tabs were in a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D241087
2025-03-12 03:02:39 +00:00
DJ
b4c31cf534 Bug 1950973 - batch process beforeUnload handlers when removing a tab group. r=dao,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D240273
2025-03-11 18:55:05 +00:00
Goloman Adrian
7f877be10f Backed out changeset edc7847f9776 (bug 1950973) for causing bc failures @browser_prompt_close_groups.js . 2025-03-07 05:08:36 +02:00
Dão Gottwald
f2fda56c21 Bug 1908439 - Drag and drop for moving a group within the window. r=dwalker,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D239494
2025-03-07 01:58:05 +00:00
Goloman Adrian
e5e07cd91e Backed out changeset 58ef1accf6e7 (bug 1908439) for causing mochitest failures @test_tabbrowser.xhtml. CLOSED TREE 2025-03-07 02:42:12 +02:00
Dão Gottwald
0fb65f4185 Bug 1908439 - Drag and drop for moving a group within the window. r=dwalker,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D239494
2025-03-06 22:20:21 +00:00
DJ
3526f7e308 Bug 1950973 - batch process beforeUnload handlers when removing a tab group. r=dao,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D240273
2025-03-06 20:59:11 +00:00
Butkovits Atila
76f1949306 Backed out changeset cd8f12bed08a (bug 1950973) for causing failures at test_restore_manually_with_tab_groups.py. CLOSED TREE 2025-03-06 18:05:15 +02:00
DJ
fb9b1427f2 Bug 1950973 - batch process beforeUnload handlers when removing a tab group. r=dao,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D240273
2025-03-06 11:25:20 +00:00
Eric Chen
11dbf7050d Bug 1915739 - Part 5: Prevent window features from being restored for taskbar tab windows r=sessionstore-reviewers,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D234542
2025-03-03 16:40:08 +00:00
Jeremy Swinarton
8ab002aa2c Bug 1950123: Allow forgetting history for closed tabs from closed groups r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D239739
2025-02-26 16:40:38 +00:00
DJ
5b2c34c50b Bug 1948078 - When restore is deferred, convert last session's open groups to saved groups. r=jswinarton,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D239451
2025-02-25 15:55:51 +00:00
Florian Quèze
3f36c09d17 Bug 1944631 - Migrate histograms to use Glean APIs for FX_SESSION_RESTORE_* histograms, r=chutten,sessionstore-reviewers,nsharpley.
Differential Revision: https://phabricator.services.mozilla.com/D238095
2025-02-19 19:52:06 +00:00
Jeremy Swinarton
782cb8d757 Bug 1936284: Open recently closed grouped tabs from Firefox View. r=dao,fxview-reviewers,sessionstore-reviewers,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D238122
2025-02-19 16:27:49 +00:00
DJ
a0b1928d27 Bug 1945169 - prevent a closing window from saving a group that is being adopted. r=dao,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D237988
2025-02-13 19:39:28 +00:00
Jeremy Swinarton
97dd33ecbd Bug 1947503: Closed tab groups code supports session store files created before Firefox 135 r=dao,dwalker,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D237904
2025-02-13 15:10:03 +00:00
Jeremy Swinarton
566b514ef6 Bug 1946761: Prevent saving tab groups in private windows r=dao,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D237588
2025-02-11 13:43:27 +00:00
Jeremy Swinarton
016c599fa5 Bug 1944416: Restore individual tabs from closed groups in closed windows r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D237110
2025-02-07 21:35:32 +00:00
Sam Foster
c32900b41c Bug 1942314 - Avoid showing sidebars and responding to sidebar events in popup windows. r=sidebar-reviewers,sessionstore-reviewers,jsudiaman,sclements
- Guard the main entry-points in SidebarController to handle the window being a popup
- Amend the test to also try the shortcut to show a sidebar in a popup window

Differential Revision: https://phabricator.services.mozilla.com/D236292
2025-02-04 07:43:21 +00:00
Jeremy Swinarton
3414d7d519 Bug 1915174: Restore closed tabs to their original tab group r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D236347
2025-02-03 14:22:39 +00:00
Jeremy Swinarton
4c0ff4a071 Bug 1940752: 'Reopen Closed Tab' tab context menu, and other paths calling undoCloseTab, support tab groups r=dao,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234680
2025-01-21 23:07:02 +00:00
Dão Gottwald
78725d1a6b Bug 1942809 - Consolidate tabs.length check by moving it into _recordSavedTabGroupState. r=dwalker
Differential Revision: https://phabricator.services.mozilla.com/D234956
2025-01-21 15:23:48 +00:00
Jeremy Swinarton
f9b9eb75c1 Bug 1932941: Add session support for closed tab groups in closed windows r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234176
2025-01-21 14:58:01 +00:00
DJ
857429c48c Bug 1937856 - prevent saving tab groups with only discarded tabs. r=dao,jswinarton,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234505
2025-01-17 14:46:24 +00:00