Closed Bug 1961663 Opened 29 days ago Closed 25 days ago

Implement tabGroups.onCreated and onRemoved

Categories

(WebExtensions :: General, enhancement, P1)

enhancement

Tracking

(firefox139 fixed)

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: zombie, Assigned: zombie)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

No description provided.
Severity: -- → N/A
Priority: -- → P1
Depends on: 1962127

Under the following circumstances, I believe that right now we do not emit a TabGroupCreate event:

  1. When restoring a previous session that included tab groups
  2. 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: nobody → tomica
Status: NEW → ASSIGNED
No longer depends on: 1962127
Depends on: 1962434
Blocks: 1962475
Attachment #9480757 - Attachment description: Bug 1961663 - Implement tabGroups.onCreated and onRemoved r?robwu!,sthompson! → Bug 1961663 - Implement tabGroups.onCreated and onRemoved r?robwu!
Blocks: 1962683
Pushed by tjovanovic@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2481422384ed Implement tabGroups.onCreated and onRemoved r=robwu
Status: ASSIGNED → RESOLVED
Closed: 25 days ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
See Also: → 1965007
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: