values set with sessions.setTabValue lost when moving tabs between windows
Categories
(Firefox :: Session Restore, defect, P3)
Tracking
()
People
(Reporter: yurivkhan, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
733 bytes,
application/zip
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Steps to reproduce:
- Start
firefox -ProfileManager. - Create a clean profile. Start Firefox.
- observed: a single window with two tabs
- Open a new window.
- In the new window’s initial tab, open
about:debugging, switch to theThis Firefoxsection, clickLoad Temporary Add-onbutton. Point to the directory containing the files extracted from the attached archive. - Click the
Inspectbutton for the extension loaded in step 3. In the Developer Tools window that opens, switch to theConsoletab. - In the console, enter:
await browser.windows.getAll({ populate: true }). Expand the resulting array, both its elements, their.tabsarrays, 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).
- In the console, enter:
await browser.sessions.setTabValue(1, 'key', 'value'). - Check that the value was set:
await browser.sessions.getTabValue(1, 'key').- Observed:
"value"
- Observed:
- Drag the
Firefox Privacy Noticetab from window 1 to window 54. - 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.
Comment 2•1 year ago
|
||
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.
(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.
Updated•1 year ago
|
Comment 4•1 year ago
|
||
(In reply to Yuri Khan from comment #1)
I have traced the issue to the
window._gBrowser.adoptTabmethod that creates a new tab in the target window, then callsswapBrowsersAndCloseOtherwhich teleports the tab’s state into the new tab and then kills the original. I imagineswapBrowsersAndCloseOthershould 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.
Comment 5•11 months ago
|
||
I was able to reproduce this issue in our latest Firefox Builds. I will update the flags for this issue.
Description
•