New issue
Advanced search Search tips

Issue 630528 link

Starred by 3 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

chrome.tabs.move gets confused about tab index when the given list of tabs are in different windows

Project Member Reported by rob@robwu.nl, Jul 22 2016

Issue description

Chrome Version: 54.0.2804.0

chrome.tabs.move() accepts a list of tabIds. This is implemented by iterating over a list of tab IDs and then moving all tabs to a specified index, and after every iteration this index is incremented [1].
That logic makes sense for tabs within a single window, but is flawed when the list of tab IDs refer to tabs in multiple windows.

To reproduce,
1. Load the attached extension.
2. Open two new tabs and example.com after that.
3. Open a new window, with two new tabs and example.com after that.
4. Click on the extension button, which basically runs
   chrome.tabs.move([tabIdFromWindow1, tabIdFromWindow2], {index: 0});

Expected:
- Either all selected tabs are moved to the first place in their originating window.
- Or all selected tabs are moved to the first place in the first matching window.

Actual:
- The tabs appear to be moved to an arbitrary position, using the logic that I described at the top of this report (see [1]).


[1] https://chromium.googlesource.com/chromium/src/+/165732a4b1dec1676bf479f2fed9a8df2a73316f/chrome/browser/extensions/api/tabs/tabs_api.cc#1499


 
manifest.json
232 bytes View Download
background.js
465 bytes View Download
Status: Available (was: Untriaged)
Issue also appearing if the tabs are in the same window. Just copy and paste the attached into a background.html inspector window.

tab-move-script.js
1.7 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 9 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment