chrome.tabGroups
- Description
Use the
chrome.tabGroups
API to interact with the browser's tab grouping system. You can use this API to modify and rearrange tab groups in the browser. To group and ungroup tabs, or to query what tabs are in groups, use thechrome.tabs
API. - Permissions
tabGroups
- AvailabilityDev channel only.
Summary
- Types
- Properties
- Methods
chrome.tabGroups.get(groupId: number, callback: function)
chrome.tabGroups.move(groupId: number, moveProperties: object, callback: function)
chrome.tabGroups.query(queryInfo: object, callback: function)
chrome.tabGroups.update(groupId: number, updateProperties: object, callback: function)
Types
TabGroup
Properties
- collapsedboolean
Whether the group is collapsed. A collapsed group is one whose tabs are hidden.
- color
The group's color.
- idnumber
The ID of the group. Group IDs are unique within a browser session.
- titlestring optional
The title of the group.
- windowIdnumber
The ID of the window that contains the group.
Color
The group's color.
Enum
"grey"
, "blue"
, "red"
, "yellow"
, "green"
, "pink"
, "purple"
, or "cyan"
Properties
TAB_GROUP_ID_NONE
An ID that represents the absence of a group.
Value
Methods
get
chrome.tabGroups.get(groupId: number, callback: function)
Retrieves details about the specified group.
move
chrome.tabGroups.move(groupId: number, moveProperties: object, callback: function)
Moves the group and all its tabs within its window, or to a new window.
Parameters
- groupIdnumber
The ID of the group to move.
- movePropertiesobject
- indexnumber
The position to move the group to. Use
-1
to place the group at the end of the window. - windowIdnumber optional
The window to move the group to. Defaults to the window the group is currently in. Note that groups can only be moved to and from windows with
windows.WindowType
type"normal"
.
- callbackfunction
query
chrome.tabGroups.query(queryInfo: object, callback: function)
Gets all groups that have the specified properties, or all groups if no properties are specified.
Parameters
- queryInfoobject
- collapsedboolean optional
Whether the groups are collapsed.
- colorColor optional
The color of the groups.
- titlestring optional
Match group titles against a pattern.
- windowIdnumber optional
The ID of the parent window, or
windows.WINDOW_ID_CURRENT
for the current window.
- callbackfunction
update
chrome.tabGroups.update(groupId: number, updateProperties: object, callback: function)
Modifies the properties of a group. Properties that are not specified in updateProperties are not modified.
Parameters
- groupIdnumber
The ID of the group to modify.
- updatePropertiesobject
- collapsedboolean optional
Whether the group should be collapsed.
- colorColor optional
The color of the group.
- titlestring optional
The title of the group.
- callbackfunction