diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/move/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/move/index.md index 904a9eaada106e2..465fb09f187044d 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/move/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/move/index.md @@ -10,7 +10,19 @@ Moves one or more tabs to a new position in the same window or to a different wi You can only move tabs to and from windows whose {{WebExtAPIRef('windows.WindowType', 'WindowType')}} is `"normal"`. -When the call moves a tab or tabs in a split view, Firefox moves the tabs in the split view together to preserve the split view. In Chrome, moving a tab away from the other tab in a split view removes the split view. +In Chrome, moving a tab away from the other tab in a split view removes the split view. This behavior may change in a future release. + +When tabs associated with a split view are moved: + +- When both tabs in a split are specified and they remain adjacent but their order is changed, the tabs are swapped in the split view. +- When both tabs in a split view are specified but are separated by one or more tabs, the tabs are moved and the split view removed. +- When only one of the tabs in a split view is moved: + - In Chrome, moving a tab away from the other tab in the split view removes the split view. Otherwise, the tabs are re-ordered as necessary. + - In Firefox, the other tab is moved to preserve the split view. The tabs are re-ordered if necessary. + > [!NOTE] + > In Firefox 149 only, when a call moves a tab or tabs in a split view, the tabs in the split view are moved together to preserve the split view and the order of the tabs is unchanged. + +See also [Working with tab split views](/en-US/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API#working_with_tab_split_views). ## Syntax diff --git a/files/en-us/mozilla/add-ons/webextensions/api/tabs/remove/index.md b/files/en-us/mozilla/add-ons/webextensions/api/tabs/remove/index.md index 901a0b1ef08ddba..c44948a52db8271 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/tabs/remove/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/tabs/remove/index.md @@ -13,6 +13,8 @@ If any of the tabs are: - part of a split view, the split view is removed. - the last tab in a group, the group is removed. +See also [Working with tab groups](/en-US/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API#working_with_tab_groups) and [Working with tab split views](/en-US/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API#working_with_tab_split_views). + ## Syntax ```js-nolint diff --git a/files/en-us/mozilla/add-ons/webextensions/working_with_the_tabs_api/index.md b/files/en-us/mozilla/add-ons/webextensions/working_with_the_tabs_api/index.md index 092d82cda0e7078..455a3b54c799145 100644 --- a/files/en-us/mozilla/add-ons/webextensions/working_with_the_tabs_api/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/working_with_the_tabs_api/index.md @@ -7,15 +7,16 @@ sidebar: addonsidebar Tabs let a user open several web pages in their browser window and then switch between those web pages. With the Tabs API, you can work with and manipulate these tabs to create utilities that provide users with new ways to work with tabs or to deliver the features of your extension. -In this how-to article we'll look at: +This how-to article look at: - Permissions needed to use the Tabs API. - Discovering more about tabs and their properties using {{WebExtAPIRef("tabs.query")}}. - Creating, duplicating, moving, updating, reloading, and removing tabs. - Manipulating a tab's zoom level. - Manipulating a tab's CSS. +- Manipulating tab groups and split views. -We then conclude by looking at some other, miscellaneous features offered by the API. +The article concludes by looking at some other, miscellaneous features offered by the API. > [!NOTE] > There are some Tab API features covered elsewhere. These are the methods you can use to manipulate tab content with scripts ({{WebExtAPIRef("tabs.connect")}}, {{WebExtAPIRef("tabs.sendMessage")}}, and {{WebExtAPIRef("tabs.executeScript")}}). If you want more information on these methods, see the Concepts article [Content scripts](/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts) and the how-to guide [Modify a web page](/en-US/docs/Mozilla/Add-ons/WebExtensions/Modify_a_web_page). @@ -553,6 +554,31 @@ Let's walk through how it's set up. }); ``` +## Working with tab groups + +Tab functionality enables users to create [group tabs](https://support.mozilla.org/en-US/kb/tab-groups). + +Various tab methods enable you to work with the content of groups, including: + +- {{WebExtAPIRef("tabs.group")}} and {{WebExtAPIRef("tabs.ungroup")}} to create or remove groups. +- {{WebExtAPIRef("tabs.move")}} to move tabs within, into, or out of a group. +- {{WebExtAPIRef("tabs.remove")}} to close tabs in a group, and close the group if the tab was the last one in the group + +> [!NOTE] +> Features to work with a tab group are provided in {{WebExtAPIRef("tabGroups")}}. + +## Working with tab split views + +Tab functionality lets display two tabs side-by-side in a [split view](https://support.mozilla.org/en-US/kb/split-view-firefox). + +Various tab methods enable you to work with the content of groups and split views, including: + +- {{WebExtAPIRef("tabs.move")}} to move tabs within or out of a split view. +- {{WebExtAPIRef("tabs.remove")}} to close a tab in a split view, which closes the split view. + +> [!NOTE] +> APIs to enable the creation and removal of split views (without moving or removing the tabs) are being developed under [issue #967](https://github.com/w3c/webextensions/issues/967) of W3C's WebExtensions Community Group (WECG). + ## Some other interesting abilities There are a couple of other Tabs API features that don't fit into one of the earlier sections: diff --git a/files/en-us/mozilla/firefox/releases/150/index.md b/files/en-us/mozilla/firefox/releases/150/index.md index e329305c03865f9..c77428a5a2fba1f 100644 --- a/files/en-us/mozilla/firefox/releases/150/index.md +++ b/files/en-us/mozilla/firefox/releases/150/index.md @@ -72,6 +72,10 @@ Firefox 150 is the current [Beta version of Firefox](https://www.firefox.com/en- ## Changes for add-on developers +- The behavior of {{WebExtAPIRef("tabs.move")}} is updated for split views so that: + - The order of tabs in a split view can be swapped. ([Firefox bug 2016762](https://bugzil.la/2016762)) + - When the list of tabs includes both split view tabs and places one or more tabs between them, the tabs are moved apart and the split view closed. ([Firefox bug 2022549](https://bugzil.la/2022549)) +