diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/color/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/color/index.md new file mode 100644 index 000000000000000..8bfa8a274c0a8e6 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/color/index.md @@ -0,0 +1,30 @@ +--- +title: tabGroups.Color +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/Color +page-type: webextension-api-type +browser-compat: webextensions.api.tabGroups.Color +--- + +{{AddonSidebar}} + +The color of a tab group. + +## Type + +Values of this type are a string and can take these values: + +- blue +- cyan +- grey +- green +- orange +- pink +- purple +- red +- yellow + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/get/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/get/index.md new file mode 100644 index 000000000000000..9ea035a74fcfe18 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/get/index.md @@ -0,0 +1,33 @@ +--- +title: tabGroups.get +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/get +page-type: webextension-api-function +browser-compat: webextensions.api.tabGroups.get +--- + +{{AddonSidebar}} + +Returns details about a tab group. + +## Syntax + +```js-nolint +let tabGroupDetails = await browser.tabGroups.get( + groupId // integer +); +``` + +### Parameters + +- `groupId` + - : `integer`. The ID of the tab group to return details for. + +### Return value + +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with a {{WebExtAPIRef("tabGroups.TabGroup")}} object. If the request fails, the promise is rejected with an error message. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/index.md new file mode 100644 index 000000000000000..26ce84c93cec489 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/index.md @@ -0,0 +1,65 @@ +--- +title: tabGroups +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups +page-type: webextension-api +browser-compat: webextensions.api.tabGroups +--- + +{{AddonSidebar}} + +This API enables extensions to modify and rearrange [tab groups](https://support.mozilla.org/en-US/kb/tab-groups). + +Tab groups may persist across browser restarts as part of session restore. Tab groups in private browsing windows do not persist across restarts. When a tab group is restored, its `groupId` may differ from its original value. + +The `tabGroups` API doesn't offer the ability to create or remove tab groups. Use the {{WebExtAPIRef("tabs.group()")}} and {{WebExtAPIRef("tabs.ungroup()")}} methods instead. To query the position of a tab group within a window, use {{WebExtAPIRef("tabs.query()")}}. These APIs in the `tabs` namespace don't require any permissions. + +## Permissions + +To use this API, an extension must request the `"tabGroups"` [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) in its [`manifest.json`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json) file. The `"tabGroups"` permission is not shown to users in permission prompts. + +## Types + +- {{WebExtAPIRef("tabGroups.Color")}} + - : The color of a tab group. +- {{WebExtAPIRef("tabGroups.TabGroup")}} + - : The state of a tab group. + +## Properties + +- {{WebExtAPIRef("tabGroups.TAB_GROUP_ID_NONE")}} + - : The tab group ID value returned when a tab isn't in a tab group. + +## Functions + +- {{WebExtAPIRef("tabGroups.get()")}} + - : Returns details about a tab group. +- {{WebExtAPIRef("tabGroups.move()")}} + - : Moves a tab group within or to another window. +- {{WebExtAPIRef("tabGroups.query()")}} + - : Returns all tab groups or finds tab groups with certain properties. +- {{WebExtAPIRef("tabGroups.update()")}} + - : Modifies the state of a tab group. + +## Events + +- {{WebExtAPIRef("tabGroups.onCreated")}} + - : Fires when a tab group is created. +- {{WebExtAPIRef("tabGroups.onMoved")}} + - : Fires when a tab group is moved within a window or to another window. +- {{WebExtAPIRef("tabGroups.onRemoved")}} + - : Fires when a tab group is removed. +- {{WebExtAPIRef("tabGroups.onUpdated")}} + - : Fires when a tab group is updated. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{WebExtAPIRef("tabs.group()")}} +- {{WebExtAPIRef("tabs.ungroup()")}} +- {{WebExtAPIRef("tabs.query()")}} +- {{WebExtAPIRef("tabs.Tab")}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/move/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/move/index.md new file mode 100644 index 000000000000000..04ff72acd286037 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/move/index.md @@ -0,0 +1,42 @@ +--- +title: tabGroups.move +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/move +page-type: webextension-api-function +browser-compat: webextensions.api.tabGroups.move +--- + +{{AddonSidebar}} + +Moves a tab group within or to another window. Groups can't be moved before a pinned tab or inside another tab group. + +## Syntax + +```js-nolint +let movedTabGroup = await browser.tabGroups.move( + groupId, // integer + moveProperties // object +); +``` + +### Parameters + +- `groupId` + + - : `integer` The ID of the tab group to move. + +- `moveProperties` + - : An object containing details of the location to move the tab group to. + - `index` + - : `integer`. The position to move the group to. After moving, the first tab in the tab group is at this index in the tab strip. Use -1 to place the group at the end of the window. + - `windowId` {{optional_inline}} + - : `integer`. The window to move the group to. Defaults to the window the group is in. Groups can only be moved to and from windows with {{WebExtAPIRef("windows.WindowType")}} type `"normal"`. + +### Return value + +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with a {{WebExtAPIRef("tabGroups.TabGroup")}} object. If the request fails, the promise is rejected with an error message. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/oncreated/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/oncreated/index.md new file mode 100644 index 000000000000000..e9cf42859848253 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/oncreated/index.md @@ -0,0 +1,60 @@ +--- +title: tabGroups.onCreated +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/onCreated +page-type: webextension-api-event +browser-compat: webextensions.api.tabGroups.onCreated +--- + +{{AddonSidebar}} + +Fires when a tab group is created. + +In Chrome, this event is also fired when a tab group is moved between windows, instead of {{WebExtAPIRef("tabGroups.onMoved")}}. + +## Syntax + +```js-nolint +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` + - : {{WebExtAPIRef("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); +``` + +{{WebExtExamples}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onmoved/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onmoved/index.md new file mode 100644 index 000000000000000..881b7bab71bbadb --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onmoved/index.md @@ -0,0 +1,73 @@ +--- +title: tabGroups.onMoved +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/onMoved +page-type: webextension-api-event +browser-compat: webextensions.api.tabGroups.onMoved +--- + +{{AddonSidebar}} + +Fires when a tab group is moved within a window or to another window. {{WebExtAPIRef("tabs.onMoved")}} also fire for the tabs within the group. + +The event is passed a {{WebExtAPIRef("tabGroups.TabGroup")}} object. This includes the `windowId` but not the position of the tab group. To determine the position of the tab group, use {{WebExtAPIRef("tabs.query()")}} with the `groupId`, and read the `index` property of the returned tab. + +In Chrome, this event doesn't fire when a tab group is moved between windows; instead, the group is removed from one window and created in another (firing {{WebExtAPIRef("tabGroups.onRemoved")}} and {{WebExtAPIRef("tabGroups.onCreated")}}. + +## Syntax + +```js-nolint +browser.tabGroups.onMoved.addListener(listener) +browser.tabGroups.onMoved.removeListener(listener) +browser.tabGroups.onMoved.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` + - : {{WebExtAPIRef("tabGroups.TabGroup")}}. Details of the moved tab group's state. + +## Examples + +Listen for and log tab group movement: + +```js +function tabGroupMoved(group) { + console.log( + `Tab group with ID ${group.id} was moved to window ${group.windowId}.`, + ); +} + +browser.tabGroups.onMoved.addListener(tabGroupMoved); +``` + +Locate a tab group moved to another window. + +```js +browser.tabGroups.onMoved.addListener(group => { + let tabs = await browser.tabs.query({ + groupId: group.id, + }); + console.log(`Moved tab group to ${tabs[0].index} in window ${group.windowId}`); +}); +``` + +{{WebExtExamples}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onremoved/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onremoved/index.md new file mode 100644 index 000000000000000..f4784a1262f9494 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onremoved/index.md @@ -0,0 +1,60 @@ +--- +title: tabGroups.onRemoved +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/onRemoved +page-type: webextension-api-event +browser-compat: webextensions.api.tabGroups.onRemoved +--- + +{{AddonSidebar}} + +Fires when a tab group is removed. This occurs when a user closes a tab group or a tab group is closed automatically because another change means it no longer contained any tabs. + +## Syntax + +```js-nolint +browser.tabGroups.onRemoved.addListener(listener) +browser.tabGroups.onRemoved.removeListener(listener) +browser.tabGroups.onRemoved.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` + - : {{WebExtAPIRef("tabGroups.TabGroup")}}. Details of the removed tab group's state. + - `removeInfo` + - : `object`. Information on why the tab group is closing. + - `isWindowClosing` + - : `boolean`. `true` if the tab group is removed because its window is closing. + +## Examples + +Listen for and log tab group removals: + +```js +function tabGroupRemoved(group) { + console.log(`Tab group with ID ${group.id} was removed.`); +} + +browser.tabGroups.onRemoved.addListener(tabGroupRemoved); +``` + +{{WebExtExamples}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onupdated/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onupdated/index.md new file mode 100644 index 000000000000000..78ed16a1cf3cc7f --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/onupdated/index.md @@ -0,0 +1,60 @@ +--- +title: tabGroups.onUpdated +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/onUpdated +page-type: webextension-api-event +browser-compat: webextensions.api.tabGroups.onUpdated +--- + +{{AddonSidebar}} + +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 {{WebExtAPIRef("tabs.onUpdated")}} and {{WebExtAPIRef("tabGroups.onMoved")}} respectively. + +To detect `windowId` changes, use {{WebExtAPIRef("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` + - : {{WebExtAPIRef("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); +``` + +{{WebExtExamples}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/query/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/query/index.md new file mode 100644 index 000000000000000..6982aa0af6db6a6 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/query/index.md @@ -0,0 +1,43 @@ +--- +title: tabGroups.query +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/query +page-type: webextension-api-function +browser-compat: webextensions.api.tabGroups.query +--- + +{{AddonSidebar}} + +Return all tab groups or find groups with certain properties. + +## Syntax + +```js-nolint +let group = await browser.tabGroups.query( + queryInfo // object +); +``` + +### Parameters + +- `queryInfo` + - : An object containing details of the property values to be matched in returned tab groups. + - `collapsed` {{optional_inline}} + - : `boolean`. Whether the returned tab groups are collapsed or expanded in the tab strip. + - `color` {{optional_inline}} + - : {{WebExtAPIRef("tabGroups.Color")}}. The name of the color returned tab groups are using. + - `shared` {{optional_inline}} + - : `boolean`. Whether the returned tab groups are shared. + - `title` {{optional_inline}} + - : `string`. The name of the tab groups to return. + - `windowId` {{optional_inline}} + - : `integer`. The ID of the window the returned tab group are in. + +### Return value + +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with an array of {{WebExtAPIRef("tabGroups.TabGroup")}} objects. If the request fails, the promise is rejected with an error message. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tab_group_id_none/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tab_group_id_none/index.md new file mode 100644 index 000000000000000..de3f0aae921ec1a --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tab_group_id_none/index.md @@ -0,0 +1,27 @@ +--- +title: tabGroups.TAB_GROUP_ID_NONE +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/TAB_GROUP_ID_NONE +page-type: webextension-api-property +browser-compat: webextensions.api.tabGroups.TAB_GROUP_ID_NONE +--- + +{{AddonSidebar}} + +The tab group ID value returned when a tab isn't in a tab group. + +Its value is `-1`. + +This value can appear as `groupId` in these API functions: + +- {{WebExtAPIRef("tabs.group()")}} +- {{WebExtAPIRef("tabs.ungroup()")}} +- {{WebExtAPIRef("tabs.query()")}} +- {{WebExtAPIRef("tabs.Tab")}} + +The `tabGroups.TAB_GROUP_ID_NONE` constant is part of the `tabGroups` namespace, which is only available when the [`tabGroups` permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabGroups#permissions) is granted. If your extension doesn't require the `tabGroups` permission, use `-1` instead of `tabGroups.TAB_GROUP_ID_NONE`. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tabgroup/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tabgroup/index.md new file mode 100644 index 000000000000000..f5cbcfc643017e0 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/tabgroup/index.md @@ -0,0 +1,31 @@ +--- +title: tabGroups.TabGroup +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/TabGroup +page-type: webextension-api-type +browser-compat: webextensions.api.tabGroups.TabGroup +--- + +{{AddonSidebar}} + +The state of a tab group. + +## Type + +Values of this type are strings. Possible values are: + +- `collapsed` + - : `boolean`. Whether the tab group is collapsed or expanded in the tab strip. +- `color` + - : {{WebExtAPIRef("tabGroups.Color")}}. The name of the user-selected color for the tab group's label and icons. +- `id` + - : `integer`. The unique ID of the tab group. Can't be {{WebExtAPIRef("tabGroups.TAB_GROUP_ID_NONE")}}. The ID of a closed tab group may be reused when a tab group is restored, but this isn't guaranteed by the API. To identify tab groups across browser restarts, look at other properties and the tabs within the tab groups. +- `title` + - : `string`. The user-defined name of the tab group. +- `windowId` + - : `integer`. The unique ID of the window the tab group is in. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/update/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/update/index.md new file mode 100644 index 000000000000000..88f9b0fddf3f6a2 --- /dev/null +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabgroups/update/index.md @@ -0,0 +1,44 @@ +--- +title: tabGroups.update +slug: Mozilla/Add-ons/WebExtensions/API/tabGroups/update +page-type: webextension-api-function +browser-compat: webextensions.api.tabGroups.update +--- + +{{AddonSidebar}} + +Modifies the state of a tab group. + +## Syntax + +```js-nolint +let updatedTabGroup = await browser.tabGroups.update( + groupId, // integer + updateProperties // object +); +``` + +### Parameters + +- `groupId` + + - : `integer` The ID of the tab group to update. + +- `updateProperties` + - : An object containing details of the properties to update for this tab group. Properties that aren't specified aren't modified. + - `collapsed` {{optional_inline}} + - : `boolean`. Whether the tab group is collapsed or expanded in the tab strip. + - `color` {{optional_inline}} + - : {{WebExtAPIRef("tabGroups.Color")}}. The name of the color to use for the tab group. + - `title` {{optional_inline}} + - : `string`. The name of the tab group. + +### Return value + +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with a {{WebExtAPIRef("tabGroups.TabGroup")}} object. If the request fails, the promise is rejected with an error message. + +{{WebExtExamples("h2")}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/group/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/group/index.md index b65724701bf0ce2..f7f1315873e1b66 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/group/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/group/index.md @@ -14,6 +14,8 @@ If a call moves tabs out of tab groups and any of those tab groups become empty, > [!NOTE] > The `tabs.group()` method is not the only way to group tabs. A tab also joins a tab group when {{WebExtAPIRef("tabs.move")}} places it between tabs that are part of a tab group. +For more information on tab groups, see {{WebExtAPIRef("tabGroups")}}. + ## Syntax ```js-nolint @@ -36,7 +38,7 @@ let grouping = browser.tabs.group( - : `integer`. The window of the new group. Defaults to the [current window](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/getCurrent). - `groupId` {{optional_inline}} - - : `integer`. The ID of the group to add the tabs to. If not specified, a new group is created. + - : `integer`. The ID of the group to add the tabs to. If not specified, a group is created. - `tabIds` - : `integer` or `array` of `integer`. The tab ID or list of tab IDs to add to the group. Must contain at least one tab ID. diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/onupdated/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/onupdated/index.md index 2c004af3232431c..cdd893343138678 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/onupdated/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/onupdated/index.md @@ -98,7 +98,7 @@ Lists the changes to the state of the tab that is updated. To learn more about t - `favIconUrl` {{optional_inline}} - : `string`. The tab's new favicon URL. Not included when a tab loses its favicon (navigating from a page with a favicon to a page without one). Check `favIconUrl` in [tab](#tab) instead. - `groupId` {{optional_inline}} - - : `integer`. The ID of the group the tabs are in or `-1` for ungrouped tabs. + - : `integer`. The ID of the group the tabs are in or `-1` ({{WebExtAPIRef("tabGroups.TAB_GROUP_ID_NONE")}}) for ungrouped tabs. - `hidden` {{optional_inline}} - : `boolean`. True if the tab is {{WebExtAPIRef("tabs.hide()", "hidden")}}. - `isArticle` {{optional_inline}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/query/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/query/index.md index 4c1f2cb0a7d9c99..8b92b099c3a83b8 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/query/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/query/index.md @@ -9,8 +9,6 @@ browser-compat: webextensions.api.tabs.query Gets all tabs that have the specified properties, or all tabs if no properties are specified. -This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - ## Syntax ```js-nolint @@ -40,7 +38,7 @@ let querying = browser.tabs.query(queryInfo) - `discarded` {{optional_inline}} - : `boolean`. Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated. - `groupId` {{optional_inline}} - - : `integer`. The ID of the tab group the tabs are in or `-1` for ungrouped tabs. + - : `integer`. The ID of the tab group the tabs are in or `-1` ({{WebExtAPIRef("tabGroups.TAB_GROUP_ID_NONE")}}) for ungrouped tabs. For more information on tab groups, see {{WebExtAPIRef("tabGroups")}}. - `hidden` {{optional_inline}} - : `boolean`. Whether the tabs are hidden. - `highlighted` {{optional_inline}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/tab/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/tab/index.md index a4f4b4d2d5fc740..e234d6bace683f2 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/tab/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/tab/index.md @@ -32,7 +32,7 @@ Values of this type are objects. They contain the following properties: - `favIconUrl` {{optional_inline}} - : `string`. The URL of the tab's favicon. Only present if the extension has the `"tabs"` [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) or [host permissions](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#host_permissions). It may also be `undefined` if the page has no favicon, or an empty string if the tab is loading. - `groupId` {{optional_inline}} - - : `integer`. The ID of the tab group the tab belongs to. Set to `-1` if the tab doesn't belong to a tab group. See {{WebExtAPIRef("tabs.group")}}. + - : `integer`. The ID of the tab group the tab belongs to. Set to `-1` ({{WebExtAPIRef("tabGroups.TAB_GROUP_ID_NONE")}}) if the tab doesn't belong to a tab group. See {{WebExtAPIRef("tabs.group")}}. For more information on tab groups, see {{WebExtAPIRef("tabGroups")}}. - `height` {{optional_inline}} - : `integer`. The height of the tab in pixels. - `hidden` diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/ungroup/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/ungroup/index.md index 9b86fe26e27e13a..fe48734e8403eb8 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/ungroup/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/ungroup/index.md @@ -14,6 +14,8 @@ All tabs in a tab group must be adjacent. If necessary, an ungrouped tab is move > [!NOTE] > The `tabs.ungroup()` method is not the only way to ungroup tabs. A tab is also ungrouped when it's moved by calling {{WebExtAPIRef("tabs.move")}} with an `index` that is outside a tab group. +For more information on tab groups, see {{WebExtAPIRef("tabGroups")}}. + ## Syntax ```js-nolint diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md index 8b39c0cc021933a..436b59870d2e01e 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md @@ -86,6 +86,7 @@ The optional API permissions are: - `search` - `sessions` - `tabHide` +- `tabGroups` - `tabs` - `topSites` - 'userScripts' ([optional-only](#optional-only_permissions)) @@ -102,6 +103,7 @@ These optional permissions are granted silently, without a user prompt: - `activeTab` - `cookies` - `idle` +- `tabGroups` - `webRequest` - `webRequestBlocking` - `webRequestFilterResponse` diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md index 8f2673f453d3c9c..0c035d164dd3889 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md @@ -127,6 +127,7 @@ These permissions are available in Manifest V2 and above unless otherwise noted: - `search` - `sessions` - `storage` +- `tabGroups` - `tabHide` - `tabs` - `theme`