function tabGroupMoved(group) {
console.log(
`Tab group with ID ${group.id} was moved to window ${group.windowId}.`,
);
}
browser.tabGroups.onMoved.addListener(tabGroupMoved);tabGroups.onMoved / notebook
tabGroups.onMoved
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
browser.tabGroups.onMoved.addListener(async (group) => {
let tabs = await browser.tabs.query({
groupId: group.id,
});
console.log(
`Moved tab group to ${tabs[0].index} in window ${group.windowId}`,
);
});