Closed Bug 1836877 Opened 3 years ago Closed 2 years ago

Follow-up for sessions.restore after "Expand recently closed tabs to include all Windows" change

Categories

(WebExtensions :: Developer Outreach, task, P2)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: robwu, Unassigned)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

In bug 1819675, the behavior of Firefox changed:

  • to include recently closed tabs from all windows.
  • the sessions.restore etension API to restore tabs to the current window, instead of the window to which the tab belonged before. This is a change in the behavior of the API, to match the behavior of the Firefox UI as part of that bug. (not any more: https://bugzilla.mozilla.org/show_bug.cgi?id=1836877#c4)

This bug is to track whether we should update the sessions.restore extension API, to add an option to offer the old behavior.

NOTE: The sessions.getRecentlyClosed extension API already returns info about all recently closed tabs. While the API specifies that the maximum number of results is only 25, due to a bug the actual implementation returns all entries (bug 1392125). Thanks to that bug, the change from bug 1819675 should have minimal impact on the getRecentlyClosed API.

Comparison with Chrome

  • sessions.restore restores the tab to the window it belonged, like Firefox up to and including version 115.
  • session.restore restores a tab to a new window if the window is closed after the tab was closed.
  • (Chrome bug:) sessions.restore fails with error "There are no browser windows to restore the session." when the only opened browsing windows are Incognito windows (incognito is like Firefox's private browsing mode). This is even if we try to restore a window.

Extension to check the behavior of sessions.getRecentlyClosed() and sessions.restore.

To use it:

  1. Visit about:debugging, this Nightly/Firefox, "Load temporary extension" button and select the zip file.
  2. Visit about:addons, go to this extension and allow it to Run in Private Windows.
  3. Click on the "Extensions" button, find the extension and click on the cog to Pin the extension button for ease of access.
  4. Click on this extension's button (the one of the add-on, not to be confused with the one from step 3) so that its panel becomes visible. It will list the reported recently closed tabs and windows, as well as offer a button to restore the items as needed.

Another behavioral change: the result of sessions.getRecentlyClosed() is currently documented to be "an array of Session objects, one for each of the most recently closed tabs or windows in the current browsing session" (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/sessions/getRecentlyClosed).

In bug 1820660 (https://phabricator.services.mozilla.com/D178521) the underlying implementation is going to include results from a previous browser session. This could potentially cause issues if extensions also persist the recently closed tabs under the assumption that these disappear at the next startup.

Some details of the changes that can be expected:

In Nightly only (behind a pref) when its ready:

  • Recently closed tabs will be persisted between sessions for the scenario where a user does not have automatic session restore enabled. Any previously open tabs will be added to the closed tabs array but will be removed from the list if a user manually restores the session. See bug 1820660 for implementation details. Its possible this will need to also persist closed windows based on the implementation for bug 1833522 (currently WIP).

I think that the sessions.restore API might be affected by the persisting of closed tabs per window due to its use of SessionStore.lastClosedObjectType. A solution to this might be to piggy-back on the approach I'm taking for the keyboard shortcut in bug 1833416 (currently expected to land in 116).

  • Expand recently closed tabs to include closed tabs from all non-private windows, see bug 1819675
  • Preserving in the recently closed tabs list once a window closes, see bug 1833522
Severity: -- → N/A
Priority: -- → P2
Whiteboard: [addons-jira]

This bug was originally filed because bug 1819675 was going to change the behavior of sessions.restore.
After some rounds of review feedback and patch revisions (in https://phabricator.services.mozilla.com/D174501 ), the final version ended up preserving the original behavior of sessions.restore .

Because of that, I am inclined to close this bug.

As a precaution, I'm moving this to the Dev Outreach component, so that we can reach out to the top add-ons that use the sessions API, to see if there are any regressions from the expanded list of entries in sessions.getRecentlyClosed.

Component: General → Developer Outreach

(In reply to Rob Wu [:robwu] from comment #4)

This bug was originally filed because bug 1819675 was going to change the behavior of sessions.restore.
After some rounds of review feedback and patch revisions (in https://phabricator.services.mozilla.com/D174501 ), the final version ended up preserving the original behavior of sessions.restore .

Because of that, I am inclined to close this bug.

As a precaution, I'm moving this to the Dev Outreach component, so that we can reach out to the top add-ons that use the sessions API, to see if there are any regressions from the expanded list of entries in sessions.getRecentlyClosed.

Now that persisting closed tabs between sessions has landed in Nightly (behind a pref), we should definitely have developers test this to see if that poses a problem as mentioned in comment 3. :luca, are you responsible for outreach?

Flags: needinfo?(lgreco)

I guess that you needinfo'd Luca because he's the triage owner this week. He's not necessarily the one to do dev outreach. We're cycling through the triage owner every week (set up using the Triage Rotation spreadsheet as announced at https://groups.google.com/a/mozilla.org/g/dev-platform/c/xXYZ0uEID5w).

I'll direct the needinfo to me since I can create a list of relevant extensions, and start the outreach process in this specific case.

Flags: needinfo?(lgreco) → needinfo?(rob)

Great, thanks Rob!

I've created a list of extensions that use the sessions API and passed that list to Sarah. She will take it from here, by providing instructions on setting the relevant prefs to test this feature on Nightly.

I expect the likelihood of regressions to be small, because the originally planned sessions.restore change did not get through as I explained in comment 4.

Flags: needinfo?(rob)

Closing as fixed, this issue was meant to be tracking communicating the changes and how to test them and per comment 8 that should be have already been done.

Rob, feel free to re-open or to change resolution if resolved/fixed is not appropriate from your perspective.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: