Commit graph

54 commits

Author SHA1 Message Date
Sarah Clements
b8cd7eaa7f Bug 1848459 - add telemetry to count closed tabs lost in session restore r=sfoster,sessionstore-reviewers
* Add histogram to sessionrestore code to count how often and the number of
closed tabs that aren't saved on window close due to no open saveable tabs
* Add test coverage

Differential Revision: https://phabricator.services.mozilla.com/D193055
2023-11-23 13:38:06 +00:00
Cosmin Sabou
99a1108422 Backed out changeset 0d228f1cfc6f (bug 1848459) for failures on browser_closed_tabs_closed_windows. CLOSED TREE 2023-11-21 17:05:42 +02:00
Sarah Clements
e578e63c18 Bug 1848459 - add telemetry to count closed tabs lost in session restore r=sfoster,sessionstore-reviewers
* Add histogram to sessionrestore code to count how often and the number of
closed tabs that aren't saved on window close due to no open saveable tabs
* Add test coverage

Differential Revision: https://phabricator.services.mozilla.com/D193055
2023-11-21 12:48:37 +00:00
Paul Zuehlcke
0e9dc5fabc Bug 1863701 - Remove SSTabClosing event. r=sessionstore-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D193069
2023-11-08 21:23:38 +00:00
Paul Zuehlcke
5e49f50910 Bug 1861215 - Skip recording closed tabs in SessionStore for PBM reset action. r=sfoster,sessionstore-reviewers,tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D192686
2023-11-08 12:07:17 +00:00
Paul Zuehlcke
80f52af4ec Bug 1861215 - Also clear closing tabs in SessionStore.purgeDataForPrivateWindow. r=sessionstore-reviewers,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D191884
2023-10-31 11:31:03 +00:00
Paul Zuehlcke
343ba506e9 Bug 1858144 - Clear session store closed tabs on reset PBM action. r=sessionstore-reviewers,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D190699
2023-10-17 10:23:51 +00:00
Sam Foster
0db730dada Bug 1833522 - Add closed tabs from closed windows to the history:recently-closed tab menus. r=dao,extension-reviewers,sessionstore-reviewers,sclements,robwu,Standard8,fxview-reviewers
* Change the signature for SessionStore.getClosedTabCount to accept either a window or options object
* Extend tests for the recently-closed-tabs menu(s)
* Add a test manifest to run the session/recently-closed tabs related extension tests with the
  legacy (false) values for the all-windows and closed tabs from closed windows prefs

Differential Revision: https://phabricator.services.mozilla.com/D186400
2023-09-08 00:36:32 +00:00
Masatoshi Kimura
9d11daf3a3 Bug 1850247 - Fix typo in the pref name. r=sessionstore-reviewers,sfoster
Depends on D186884

Differential Revision: https://phabricator.services.mozilla.com/D186885
2023-08-31 16:58:13 +00:00
Sam Foster
7075d4e4c8 Bug 1845836 - Include closed tabs from closed windows in fxview-next's recently closed tabs list. r=kcochrane,dao,fxview-reviewers,sessionstore-reviewers,sclements
* Add a browser.sessionstore.closedTabsFromClosedWindows pref and consult it when building recently-closed tab lists in firefoxview-next
* Add a _resolveClosedDataSource to SessionStore which allows us to find the window state and _closedTabs given a DOMWindow, a window closedId, or a window session store Id.
* Carry window closedId and source window Id into tab items when building recently-closed tab lists in firefoxview-next. This gives us the necessary context when we need to undoClose or forget a tab item in the list.
* Add a getClosed TabCount and TabData for Closed Windows method to SessionStore
* Modify undoCloseTab and forgetClosedTab to accept source params we can resolve to window state data using _resolveClosedDataSource

Differential Revision: https://phabricator.services.mozilla.com/D185108
2023-08-22 20:42:57 +00:00
Sam Foster
165bfa3ba4 Bug 1847617 - Add about:home to the list of URLs we filter out when deciding if a closing window has state that should be saved. r=dao,sessionstore-reviewers
* And fix the urlbar test that breaks now that about:home tabs with no history aren't saved when closed.

Differential Revision: https://phabricator.services.mozilla.com/D185605
2023-08-11 19:14:51 +00:00
Cristian Tuns
dcf50463d3 Backed out changeset 4ab6eb349233 (bug 1847617) for causing bc failures in /browser_aboutHomeLoading.js CLOSED TREE 2023-08-08 23:57:39 -04:00
Sam Foster
df35ca0918 Bug 1847617 - Add about:home to the list of URLs we filter out when deciding if a closing window has state that should be saved. r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185605
2023-08-08 23:05:51 +00:00
Sam Foster
6e8f34b18c Bug 1842610 - Add SessionStore.forgetClosedWindowById and forgetClosedTabById and update RecentlyClosedTabsInView to use the new forget and aggregated getClosedTabData methods. r=kcochrane,fxview-reviewers,sessionstore-reviewers,dao,sclements
* We already make use of the closedId in RecentlyClosedTabsInView to re-open the tab via SS.undoCloseById so it made sense to do the same for forgetting a closed tab
* In the test setup, one of tabs is opened and closed in a different window. This gives us coverage both for the closed tab list rendering, as well as re-opening and forgeting tabs with different source windows
* Both the forget-by-closed-id methods match undoClosedById's behavior and throw if the closedId doesnt match a closed window or tab

Differential Revision: https://phabricator.services.mozilla.com/D184192
2023-07-31 18:54:43 +00:00
Gregory Pappas
3eac12bbd7 Bug 1845311 - Use ChromeUtils.defineLazyGetter in more places r=arai,webdriver-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,anti-tracking-reviewers,sessionstore-reviewers,pbz,joschmidt,robwu,issammani,bytesized,owlish,dao
Differential Revision: https://phabricator.services.mozilla.com/D184481
2023-07-26 16:28:11 +00:00
Sarah Clements
1a1b01a996 Bug 1844791 - Change maxLength splice to slice in SessionStore._lastClosedActions r=sfoster,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184246
2023-07-21 21:59:59 +00:00
Sam Foster
2df4be65fa Bug 1842895 - Rename SessionStoreInternal._closedTabs and _closedWindowTabs to differentiate from other closedTabs collections. r=sessionstore-reviewers,sclements
Differential Revision: https://phabricator.services.mozilla.com/D183300
2023-07-19 16:37:15 +00:00
Sarah Clements
84ec9ebeeb Bug 1843587 - Change getClosedTabData param to default to non-private window object r=sfoster,fxview-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183739
2023-07-18 11:11:21 +00:00
Sarah Clements
7e6847ff4f Bug 1820660 - Persist recently closed tabs between sessions r=dao,sfoster,extension-reviewers,sessionstore-reviewers,robwu
* For cases where a user does not have automatic session restore enabled, recently closed
tabs will persist between sessions and previously open tabs will be added to the recently closed tabs
list; upon manual session restore, the previously open tabs will reopen and be removed from the closed tabs list

* Add marionette test and fix test bustages due to these changes.

Differential Revision: https://phabricator.services.mozilla.com/D178521
2023-07-18 10:40:00 +00:00
Sam Foster
224b568ae4 Bug 1819675 - Introduce a feature pref to toggle the recently-closed tabs from all windows behavior.r=sclements,dao,extension-reviewers,fxview-reviewers,robwu,sessionstore-reviewers
* Add a default-true pref to provide an escape hatch allowing us to revert to previous behavior
* in which recently-closed tabs are per-window,
* and undoing closed tabs restores them to the window they were closed from.
* Ensure we set the pref for tests which depend on its value
* Add some spot-checks in tests with the pref off

Differential Revision: https://phabricator.services.mozilla.com/D179574
2023-07-06 22:49:52 +00:00
Sam Foster
a24c7b1d6b Bug 1819675 - Include tabs from all windows in all views of recently-closed tabs and re-open them into the current window. r=dao,sclements,fxview-reviewers,fluent-reviewers,flod,robwu,sessionstore-reviewers,tabbrowser-reviewers
* Menu Bar History menu recently-closed tab items includes closed tabs from all currently-open windows
* Toolbar/Appmenu history menu recently-closed tabs list includes closed tabs from all currently-open windows
* Firefox view recently-closed tab list includes closed tabs from all currently-open windows
* All recently-closed tab menu/items re-open in the current window
* Re-open all tabs menu item re-opens all tabs into the current window

* Ensure we filter out tabs without any useful state in firefox-view
* Add a target window argument to undoCloseTab and undoCloseById
* undoCloseTab will remove the tab data from the source window collection and re-open the tab into the target window
* Add an options argument to SessionStore.getWindows to get all private or non-private windows
* Add a getWindowForTabClosedId method on SessionStore, allowing look-up of the window associated with a closed tab
* Ensure recently-closed tab lists only include tabs from non-private windows when attached (i.e. opened from) a non-private window. And vice-versa.
* Update the sessionstore closed tab tests to assert on the new behavior

* Update the browser.sessions.restore implementation to always find and pass the source window when restoring a closed tab
* sessions.restore should always restore closed tabs to the source window as there's no implicit top or current window in the API context

Differential Revision: https://phabricator.services.mozilla.com/D174501
2023-07-06 22:49:52 +00:00
Cosmin Sabou
f16c094fd9 Backed out 2 changesets (bug 1819675) for causing a spike in wpt and browser-chrome failures.
Backed out changeset aa4368bfb81a (bug 1819675)
Backed out changeset e5be8edfd9cf (bug 1819675)
2023-07-08 13:44:40 +03:00
Sam Foster
a4876c8eb5 Bug 1819675 - Introduce a feature pref to toggle the recently-closed tabs from all windows behavior.r=sclements,dao,extension-reviewers,fxview-reviewers,robwu,sessionstore-reviewers
* Add a default-true pref to provide an escape hatch allowing us to revert to previous behavior
* in which recently-closed tabs are per-window,
* and undoing closed tabs restores them to the window they were closed from.
* Ensure we set the pref for tests which depend on its value
* Add some spot-checks in tests with the pref off

Differential Revision: https://phabricator.services.mozilla.com/D179574
2023-07-06 22:49:52 +00:00
Sam Foster
39d8ed9ddf Bug 1819675 - Include tabs from all windows in all views of recently-closed tabs and re-open them into the current window. r=dao,sclements,fxview-reviewers,fluent-reviewers,flod,robwu,sessionstore-reviewers,tabbrowser-reviewers
* Menu Bar History menu recently-closed tab items includes closed tabs from all currently-open windows
* Toolbar/Appmenu history menu recently-closed tabs list includes closed tabs from all currently-open windows
* Firefox view recently-closed tab list includes closed tabs from all currently-open windows
* All recently-closed tab menu/items re-open in the current window
* Re-open all tabs menu item re-opens all tabs into the current window

* Ensure we filter out tabs without any useful state in firefox-view
* Add a target window argument to undoCloseTab and undoCloseById
* undoCloseTab will remove the tab data from the source window collection and re-open the tab into the target window
* Add an options argument to SessionStore.getWindows to get all private or non-private windows
* Add a getWindowForTabClosedId method on SessionStore, allowing look-up of the window associated with a closed tab
* Ensure recently-closed tab lists only include tabs from non-private windows when attached (i.e. opened from) a non-private window. And vice-versa.
* Update the sessionstore closed tab tests to assert on the new behavior

* Update the browser.sessions.restore implementation to always find and pass the source window when restoring a closed tab
* sessions.restore should always restore closed tabs to the source window as there's no implicit top or current window in the API context

Differential Revision: https://phabricator.services.mozilla.com/D174501
2023-07-06 22:49:52 +00:00
Adam Vandolder
e0fc545cbc Bug 1556358 - Part 3: Restore FACE state in SessionStore. r=edgar,farre
Depends on D174115

Differential Revision: https://phabricator.services.mozilla.com/D179278
2023-06-28 16:28:27 +00:00
Katherine Patenio
130ce23c4c Bug 1834831 - update imports of browser/modules JSMs r=webdriver-reviewers,perftest-reviewers,zeid,extension-reviewers,settings-reviewers,pip-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,sessionstore-reviewers,tabbrowser-reviewers,whimboo,mhowell,sgalich,robwu,sparky,Standard8,mconley,dao,sclements
Differential Revision: https://phabricator.services.mozilla.com/D179169
2023-06-19 18:44:48 +00:00
Cristian Tuns
110cfccc1f Backed out 2 changesets (bug 1834831) for causing node failures with checkBundles CLOSED TREE
Backed out changeset 58b351a155c8 (bug 1834831)
Backed out changeset 1acbb5231d14 (bug 1834831)
2023-06-19 13:22:35 -04:00
Katherine Patenio
a73f6ec769 Bug 1834831 - update imports of browser/modules JSMs r=webdriver-reviewers,perftest-reviewers,zeid,extension-reviewers,settings-reviewers,pip-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,sessionstore-reviewers,tabbrowser-reviewers,whimboo,mhowell,sgalich,robwu,sparky,Standard8,mconley,dao,sclements
Differential Revision: https://phabricator.services.mozilla.com/D179169
2023-06-19 16:46:18 +00:00
Stanca Serban
cb33cee97e Backed out 3 changesets (bug 1556358) for causing Bb build bustages in ElementInternals.cpp. CLOSED TREE
Backed out changeset f7e94ea82252 (bug 1556358)
Backed out changeset c80f29a9cefc (bug 1556358)
Backed out changeset 413225d91666 (bug 1556358)
2023-06-16 19:46:02 +03:00
Adam Vandolder
61ab1463b6 Bug 1556358 - Part 3: Restore FACE state in SessionStore. r=edgar,farre
Depends on D174115

Differential Revision: https://phabricator.services.mozilla.com/D179278
2023-06-16 15:02:11 +00:00
Sarah Clements
eb795dabb9 Bug 1833416 - modify undoClosedTab keyboard shortcut r=mconley,sfoster,sessionstore-reviewers,dao
* This patch expands this keyboard shortcut to support whichever of the three
last actions were taken - last tab closed, last window closed or session restore.
* Existing test file was renamed and additional cases added.

Differential Revision: https://phabricator.services.mozilla.com/D178965
2023-06-15 13:28:26 +00:00
Noemi Erli
c9a78e6659 Backed out 3 changesets (bug 1556358) for causing bustages in ElementInternals.cpp CLOSED TREE
Backed out changeset 0ebda393786b (bug 1556358)
Backed out changeset c41794eef66a (bug 1556358)
Backed out changeset a07e3e226569 (bug 1556358)
2023-06-15 01:32:38 +03:00
Adam Vandolder
8149717b64 Bug 1556358 - Part 3: Restore FACE state in SessionStore. r=edgar,farre
Depends on D174115

Differential Revision: https://phabricator.services.mozilla.com/D179278
2023-06-14 20:59:29 +00:00
Cosmin Sabou
c884b4c9ec Backed out changeset 0e2af922ec2a (bug 1820660) for causing webdriver failures on add_cookie/user_prompts.py. CLOSED TREE 2023-06-13 13:52:12 +03:00
Sarah Clements
46eac9314d Bug 1820660 - Persist recently closed tabs between sessions r=dao,sfoster,extension-reviewers,sessionstore-reviewers,robwu
* For cases where a user does not have automatic session restore enabled, recently closed
tabs will persist between sessions and previously open tabs will be added to the recently closed tabs
list; upon manual session restore, the previously open tabs will reopen and be removed from the closed tabs list

* Add marionette test and fix test bustages due to these changes.

Differential Revision: https://phabricator.services.mozilla.com/D178521
2023-06-13 08:58:17 +00:00
Kershaw Chang
5149a41b0e Bug 1543990 - Simplify nsISpeculativeConnect API, r=necko-reviewers,geckoview-reviewers,search-reviewers,valentin,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D179066
2023-06-01 09:46:12 +00:00
Sam Foster
a3004a21be Bug 1819675 - rename SessionStore.getClosedTabCount and getClosedTabData to getClosedTabCountForWindow and getClosedTabDataForWindow. r=dao,fxview-reviewers,kcochrane
- As closed tabs will change to mean closed tabs from all windows, rename these functions to make
  changes in later patches clearer when we mean closed tabs from this window specifically, or closed
  tabs for all private/non-private windows

Differential Revision: https://phabricator.services.mozilla.com/D177849
2023-05-30 18:54:12 +00:00
Emilio Cobos Álvarez
fe4ef8dafa Bug 1834042 - Use screen slop rather than hard-coded slop on session restore. r=Gijs
The hard-coded slop is too small for some GTK themes, which causes the
window to be pulled into screen to (0, 0), which becomes
(decorationWidth, decorationHeight), in fact.

Keep the previous slop as a minimum, to avoid changing windows / macOS
behavior.

An alternative to this approach would be for the Linux code to handle
this "transparently", but that involves lying about the real widget
position in some cases but not others, which seems like it'd be
extremely error prone for relatively little gain.

Depends on D179110

Differential Revision: https://phabricator.services.mozilla.com/D179111
2023-05-30 09:43:59 +00:00
Mark Banner
130a655906 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner
8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Daisuke Akatsuka
73dc3820cc Bug 1824040: Make the loading URL opened in _blank target to be the target of Session Restore r=mak,smaug,farre,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D173790
2023-04-14 01:59:44 +00:00
Gijs Kruitbosch
6e92bec207 Bug 1823706 - rename addMultipleTabs and batchInsertingTabs parameter for clarity, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D173271
2023-03-23 10:00:35 +00:00
Gijs Kruitbosch
78ae8aa771 Bug 1822854 - ensure session store doesn't assume _tPos is set and has good stub info for recently restored tabs so we don't break manual session restore, r=dao
Either of these changes (ie dropping the setTabState call for batch restored
tabs, or ensuring the restoreTabs code correctly fills its array with dummy
entries) is sufficient here. I chose to do both because I think in both cases
the brokenness is not limited to this scenario or the issues at hand.

Specifically, the setTabState call was added in bug 1521346 to deal with
moved lazy tabs, but is now being invoked for session restore because of
the batchInsertingTabs optimization work. It doesn't actually need to be,
as far as I can tell, and the lacking _tPos in this case (because we don't
insert the tab into the tabstrip a few lines above) is what breaks things
inside _ensureNoNullsInTabDataList. Note that this _already_ was breaking
things in restoreTab(), which would assign into tabs[undefined] on the
window state object, so just dropping the call seemed better than wallpapering
the absence of _tPos.

The restoreTabs code, pre-patch, calls _ensureNoNullsInTabDataList but that
will never do anything, because right before calling it we change the array
length, so maxPos was always smaller than the size of the list. This meant
we still had empty slots in the array, which was also causing confusion down
the line.

I added the explicit exception for the broken _tPos in restoreTab so that we
notice any future issues with this more quickly. Doing so without any of the
other fixes broke the pre-existing browser_586068-apptabs.js test, so
hopefully that will catch any future changes that break the code's assumptions.

Differential Revision: https://phabricator.services.mozilla.com/D173070
2023-03-21 16:29:06 +00:00
Gijs Kruitbosch
f3bbef4640 Bug 1763279 - fix session store tab data sanity checks to not be terrible for performance, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D170755
2023-02-28 08:01:34 +00:00
Gijs Kruitbosch
9d7452a247 Bug 1810141 - update consumers of CanonicalBrowsingContext.loadURI to use fixup or pass a URI object if they have it, r=mak,webdriver-reviewers,whimboo
Depends on D168389

Differential Revision: https://phabricator.services.mozilla.com/D168390
2023-02-13 23:50:38 +00:00
Cristina Horotan
5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch
e460aa10f3 Bug 1810141 - update consumers of CanonicalBrowsingContext.loadURI to use fixup or pass a URI object if they have it, r=mak,webdriver-reviewers,whimboo
Depends on D168389

Differential Revision: https://phabricator.services.mozilla.com/D168390
2023-02-13 12:55:22 +00:00
Mark Banner
a94fe03b9d Bug 1811334 - Automatically replace Cu.reportError with console.error (most of browser/components). r=settings-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D167297
2023-01-20 17:49:21 +00:00
Andreas Farre
333f9b4d80 Bug 1810704 - Collect telemetry for session history collection time. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D167033
2023-01-19 06:45:55 +00:00
Sarah Clements
ec2009c58b Bug 1804064 - Firefox View window should not be saved r=Gijs,kcochrane
* If Firefox view tab is the last selected tab when a window is closed it
should not be saved; the first tab should be used instead. This patch updates a test,
updates the title that is saved and the selected index

Differential Revision: https://phabricator.services.mozilla.com/D166362
2023-01-11 11:59:19 +00:00