Closed Bug 1829161 Opened 2 years ago Closed 2 years ago

Reopen-closed-tab via extensions stops working after opening a link from an external software directly into a container

Categories

(Firefox :: Session Restore, defect, P2)

Firefox 114
defect

Tracking

()

VERIFIED FIXED
115 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox112 --- unaffected
firefox113 --- unaffected
firefox114 + verified
firefox115 --- verified

People

(Reporter: Fanolian+BMO, Assigned: daisuke)

References

(Regression)

Details

(Keywords: nightly-community, regression, reproducible)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Build ID: 20230420092216

Steps to reproduce

Prerequisites

  1. In a new profile, install any extension that can reopen a closed tab, e.g. Undo Close Tab (UCT).
  2. Install any extension that can auto-reopen a tab into a (different) container, e.g. Facebook Container[1].
  3. Check if reopening a closed tab is still working at this stage:
    3a. Open a dummy tab so browser does not quit after closing all other tabs.
    3b. Open https://www.facebook.com, or any link, from within Nightly.
    3c. Close the tab in 3b.
    3d. Click UCT extension icon to reopen last closed tab.
    3e. 3b should reopen at this stage.

Reproducing the bug

  1. Open https://www.facebook.com from any external software to the above Nightly profile. I use WordPad (not Notepad) and paste https://www.facebook.com in a document. (Or open any link that will auto-open in a container, if Facebook Container extension is not used.)
    This Facebook tab should open in a Facebook container.
  2. Close this tab. Remember to keep a dummy tab.
  3. Click UCT extension icon.

[1]: For some reason Facebook Container cannot be used for bisecting in Mozregression GUI because the first Facebook tab - triggered by mozregression's URL field - does not open in a container. Please use Firefox Multi-Account Containers instead and set up accordingly.
Facebook Container can be used in a locally installed Nightly.

Actual results

The facebook tab does not reopen. Actually all subsequent closed tabs, originated from within or outside Nightly, cannot be reopened.
Browser Console shows these errors after clicking UCT:

can't access property "url", entry is undefined ext-browser.js:911
    convertFromSessionStoreClosedData chrome://browser/content/parent/ext-browser.js:911
    getRecentlyClosed chrome://browser/content/parent/ext-sessions.js:46
    getRecentlyClosed chrome://browser/content/parent/ext-sessions.js:138
    InterpretGeneratorResume self-hosted:1551
    AsyncFunctionNext self-hosted:948
Error: An unexpected error occurred undefined

I can, however, reopen closed tabs by the native Reopen Closed Tab command in tab bar's context menu, or Ctrl-Shift-T.

Workarounds

I can restore the reopen closed tabs function by:

  1. quitting Nightly and start a new session. If the previous session had triggered the bug, it will carry over once I restore this session. Or
  2. opening a new window then close the window that has the tab opened externally. The reopening function restores immediately.

Notes

I tested few other extensions that do not work in this case:

Undo tabs

Undo Closed Tabs Button
Foxy Gestures (draw a gesture to reopen a tab)

Auto-reopen tabs in a container

Temporary Containers' Automatic Mode
Firefox Multi-Account Containers' Always Open This Site in…

Regression

Last good Nightly: 2023-04-13
First bad Nightly: 2023-04-14
pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5c9aa60ea6f47114a9367f56c50cd13299aa1d29&tochange=7011cafe7d2c47b84c7437e856809945cd5c77ba

Bisecting autoland builds: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e55b487ddf10347934259b4771ed922174a56c62&tochange=fb24fd4183358d0c91f5878cf446623f835d4be8

This is regressed by bug 1824040.

Flags: needinfo?(daisuke)

[Tracking Requested - why for this release]:
Containers extensions are affected, including 2 Firefox-made extensions. The bug has to be triggered by another type of extension though (reopening closed tabs).

Has STR: --- → yes
Regressed by: 1824040

Additional note:
The bug is not triggered if the link from external software does not result in a container. For example, clicking https://www.google.com in WordPad when only Facebook Container is installed.

Summary: Reopen-closed-tab via extensions stops working after opening an external link directly into a container → Reopen-closed-tab via extensions stops working after opening a link from an external software directly into a container

Thank you very much for your report, Fanolian!
I also could reproduce this, will take a look.

Flags: needinfo?(daisuke)
Assignee: nobody → daisuke
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Daisuke, could you set the Severity and Priority of this bug? Thanks

Flags: needinfo?(daisuke)

Sure!

Severity: -- → S3
Flags: needinfo?(daisuke)
Priority: -- → P2

The bug is marked as tracked for firefox114 (nightly). However, the bug still has low severity.

:cbellini, could you please increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit auto_nag documentation.

Flags: needinfo?(cbellini)
Severity: S3 → S2

Daisuke, will you fix that before the merge to beta?

Set release status flags based on info from the regressing bug 1824040

Pushed by dakatsuka.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9d7b9314802e Make the tab loading non-web-controlled page in _blank target as 1-based. r=extension-reviewers,farre,rpl,Gijs
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
Flags: needinfo?(cbellini)

The patch landed in nightly and beta is affected.
:daisuke, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox114 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(daisuke)

Comment on attachment 9329882 [details]
Bug 1829161: Make the tab loading non-web-controlled page in _blank target as 1-based.

Beta/Release Uplift Approval Request

  • User impact if declined: Session restoration by Addon is not correct when handling non-web-controlled loading pages.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The changes in the main code is only one line.
    And it affects only when handling non-web-controlled loading pages.
  • String changes made/needed: none
  • Is Android affected?: Unknown
Flags: needinfo?(daisuke)
Attachment #9329882 - Flags: approval-mozilla-beta?

Comment on attachment 9329882 [details]
Bug 1829161: Make the tab loading non-web-controlled page in _blank target as 1-based.

Approved for 114 beta 4, thanks.

Attachment #9329882 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified as Fixed on the latest Nightly (115.0a1/20230514213610) and Beta (114.0b4/20230514175823). Tested on Windows 10 x64.

Clicking the UCT extension icon will now properly re-open the closed tab with https://www.facebook.com/ which was initially opened from an external software – LibreOffice Writer in my particular case.

Tested Beta 114.0b3 as well for comparison and the issue occurs there as described in Comment 0.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: