tabGroups.onUpdated
Fires when a tab group's state changes.
Fires when a tab group's state changes.
This event does not fire when the group's membership changes or when a tab group is moved. Those updates are covered by tabs.onUpdated and tabGroups.onMoved respectively.
To detect `windowId` changes, use tabGroups.onMoved instead.
## Syntax
```js-nolint
browser.tabGroups.onUpdated.addListener(listener)
browser.tabGroups.onUpdated.removeListener(listener)
browser.tabGroups.onUpdated.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 updated tab group's state.
## Examples
Listen for and log tab group updates:
```js
function tabGroupUpdated(group) {
console.log(`Tab group with ID ${group.id} was updated.`, group);
}
browser.tabGroups.onUpdated.addListener(tabGroupUpdated);
```
## Browser compatibility
Cite this
"tabGroups.onUpdated". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabGroups/onUpdated JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy