Implement tabGroups.onCreated and onRemoved
Categories
(WebExtensions :: General, enhancement, P1)
Tracking
(firefox139 fixed)
Tracking | Status | |
---|---|---|
firefox139 | --- | fixed |
People
(Reporter: zombie, Assigned: zombie)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
Updated•29 days ago
|
Assignee | ||
Updated•28 days ago
|
Comment 1•27 days ago
|
||
Under the following circumstances, I believe that right now we do not emit a TabGroupCreate event:
- When restoring a previous session that included tab groups
- When reopening a saved tab group
These go through this code path https://searchfox.org/mozilla-central/rev/8867630d67bfe76f6065df08d60381d45d73c439/browser/components/tabbrowser/content/tabbrowser.js#3674 to create the <tab-group> element without using addTabGroup
and therefore not raising TabGroupCreate
. Right now, addTabGroup
will insert the <tab-group> into the DOM and move tabs into it, but the session restore machinery assembles all of the DOM elements itself before dropping them into the live DOM in one go.
I'm not sure whether you think onCreated should be fired for tab groups when restoring a session with tab groups. Whatever makes sense there.
I would expect onCreated to be fired when the user reopens a saved tab group. Right now, these are using the same code paths in Tabbrowser, but this code path https://searchfox.org/mozilla-central/rev/8867630d67bfe76f6065df08d60381d45d73c439/browser/components/sessionstore/SessionStore.sys.mjs#8196 is unique to reopened a saved tab group. We could raise some kind of event here. Or, if it's better to be consistent and always have TabGroupCreate
, we can fire that in Tabbrowser.createTabsForSessionRestore after the tab groups have been inserted into the DOM.
Assignee | ||
Comment 2•26 days ago
|
||
Updated•26 days ago
|
Updated•26 days ago
|
Comment 4•25 days ago
|
||
bugherder |
Description
•