Movatterモバイル変換


[0]ホーム

URL:


  1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. tabGroups
  6. tabGroups.onCreated

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 oftabGroups.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. Thelistener argument is the listener to remove.

hasListener(listener)

Checks whetherlistener is registered for this event. Returnstrue 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

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp