Open Bug 1929000 Opened 1 year ago Updated 11 months ago

values set with sessions.setTabValue lost when moving tabs between windows

Categories

(Firefox :: Session Restore, defect, P3)

Firefox 132
defect

Tracking

()

Tracking Status
firefox-esr128 --- affected
firefox138 --- affected
firefox139 --- affected
firefox140 --- affected

People

(Reporter: yurivkhan, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file webext-tabvalues.zip

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0

Steps to reproduce:

  1. Start firefox -ProfileManager.
  2. Create a clean profile. Start Firefox.
    • observed: a single window with two tabs
  3. Open a new window.
  4. In the new window’s initial tab, open about:debugging, switch to the This Firefox section, click Load Temporary Add-on button. Point to the directory containing the files extracted from the attached archive.
  5. Click the Inspect button for the extension loaded in step 3. In the Developer Tools window that opens, switch to the Console tab.
  6. In the console, enter: await browser.windows.getAll({ populate: true }). Expand the resulting array, both its elements, their .tabs arrays, and their elements .
    • Observed (for example): window id 1 with tabs id 1 (Firefox Privacy Notice) and 2 (Welcome to Firefox), and window id 54 with tab id 3 (Debugging).
  7. In the console, enter: await browser.sessions.setTabValue(1, 'key', 'value').
  8. Check that the value was set: await browser.sessions.getTabValue(1, 'key').
    • Observed: "value"
  9. Drag the Firefox Privacy Notice tab from window 1 to window 54.
  10. Attempt to retrieve the moved tab’s custom value: await browser.sessions.getTabValue(1, 'key').

Actual results:

Observed: undefined.

Expected results:

Expected: "value".

I have traced the issue to the window._gBrowser.adoptTab method that creates a new tab in the target window, then calls swapBrowsersAndCloseOther which teleports the tab’s state into the new tab and then kills the original. I imagine swapBrowsersAndCloseOther should be re-associating the original tab’s custom values to the new tab.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #2)

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Hm. I’d maybe suggest Firefox::Tabbed Browser or WebExtensions::General.

Component: Widget: Gtk → Session Restore
Product: Core → Firefox

(In reply to Yuri Khan from comment #1)

I have traced the issue to the window._gBrowser.adoptTab method that creates a new tab in the target window, then calls swapBrowsersAndCloseOther which teleports the tab’s state into the new tab and then kills the original. I imagine swapBrowsersAndCloseOther should be re-associating the original tab’s custom values to the new tab.

We already copy over permanentKey, so perhaps session restore could use that to keep track of the tab data.

Severity: -- → S3
Priority: -- → P3

I was able to reproduce this issue in our latest Firefox Builds. I will update the flags for this issue.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
QA Whiteboard: [qa-investig-done-c140/b139]
Ever confirmed: true
QA Contact: rdoghi
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: