Bug in chrome.tabGroups.move() API ?!

302 views
Skip to first unread message

Wolfgang Steiner

unread,
Feb 19, 2023, 12:44:48 PM2/19/23
to Chromium Extensions
Hi,
I am currently writing a chrome extension that lets you change the order of chrome tabs & tab-groups in a dedicated UI inside the extension.
(when you move tabs/groups in the UI, they also immediately update their position in the original Chrome tab-bar of the browser)

To move tab-groups, I am using the chrome.tabGroups.move() extension API.
But I have encountered one very strange error (a bug?) when moving tab-groups this way.

Pretty much all cases work well so far, but in the case when a user tries to move a tab-group right next to the last tab of another tab-group, there appears to be a bug in the extension API that is preventing me from doing that.
(or maybe I am using it wrong, please let me know)

I have created a minimal reproduction case on Github that shows the bug:

I would be happy if someone could confirm that this is indeed a bug in the API or if I am using it incorrectly.

Thanks 🙏

wOxxOm

unread,
Feb 19, 2023, 1:04:01 PM2/19/23
to Chromium Extensions, Wolfgang Steiner
It certainly looks like a bug, you can report it on https://crbug.com.

The workaround may be to create an empty tab between the groups, then remove it. It may look jarring though, so another workaround may be to ungroup the tabs first, then call chrome.tabs.move(arrayOfTabIds, {index: 3}), then group them.

Wolfgang Steiner

unread,
Feb 19, 2023, 1:11:32 PM2/19/23
to Chromium Extensions, wOxxOm, Wolfgang Steiner
I will try out the workarounds you suggested and report the issue to https://crbug.com
Thanks!

Wolfgang Steiner

unread,
Feb 19, 2023, 1:31:46 PM2/19/23
to Chromium Extensions, Wolfgang Steiner, wOxxOm
Reply all
Reply to author
Forward
0 new messages