tabGroups.onCreated

Fires when a tab group is created.

In Chrome, this event is also fired when a tab group is moved between windows, instead of tabGroups.onMoved.

Syntax

js
browser.tabGroups.onCreated.addListener(listener)
browser.tabGroups.onCreated.removeListener(listener)
browser.tabGroups.onCreated.hasListener(listener)

Events have three functions:

addListener(listener)

Adds a listener to this event.

removeListener(listener)

Stops listening to this event. The listener argument is the listener to remove.

hasListener(listener)

Checks whether listener is registered for this event. Returns true if it is listening, false otherwise.

addListener syntax

Parameters

listener

The function called when this event occurs. The function is passed this argument:

group

tabGroups.TabGroup. Details of the created tab group's state.

Examples

Listen for and log tab group creation:

js
function tabGroupCreated(group) {
  console.log(
    `Tab group with ID ${group.id} was created in window ${group.windowId}.`,
  );
}

browser.tabGroups.onCreated.addListener(tabGroupCreated);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
onCreated
Chrome – Full support
Chrome 89 (Release date: 2021-03-02)
footnote Full support
Edge – Full support
Edge 89 (Release date: 2021-03-04)
footnote Full support
Firefox – Full support
Firefox 139 (Release date: 2025-05-27)
footnote Full support
Opera – Full support
Opera 75 (Release date: 2021-03-24)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support