Closed Bug 1248093 Opened 4 years ago Closed 4 years ago

tab.move to index zero doesn't work with pinned tabs


(WebExtensions :: Untriaged, defect)

Not set


(Not tracked)



(Reporter: andy+bugzilla, Assigned: andy+bugzilla)


(Keywords: dev-doc-complete, Whiteboard: [tabs])

* create a pinned tab
* call chrome.tabs.move([], {index: 0});

* tab moves to the first tab after the pinned tabs

* tab does not move
This is actually the expected behavior. Not the documented behavior, granted, but it's what Chrome does.
Closed: 4 years ago
Keywords: dev-doc-needed
Resolution: --- → INVALID
It seems like the behavior of move is that pinned and unpinned tabs are treated as distinct groups, and you can't move tabs from one group to another. So you:

* can't move an unpinned tab before any pinned tabs

* can't move a pinned tab after any unpinned tabs

If you try, you get a silent failure (nothing happens). Is that your understanding?

This behavior makes the example add-on tabs-tabs-tabs appear broken when any tabs are pinned, and I think maybe we should fix it. I've made a PR which seems to fix it: if you think it is a good idea to fix this, would you mind taking a look?
Flags: needinfo?(kmaglione+bmo)
Flags: needinfo?(kmaglione+bmo)
Thanks for reviewing the example update.
I've had a go at the docs:

Weirdest thing I found: it looks like in Chrome, if you try to move a tab and it fails (for example, because you tried to move an unpinned tab to before a pinned tab), then Chrome will still pass the tab into the callback, with the index that it would have been given, if the move had not failed.
Flags: needinfo?(kmaglione+bmo)
That... makes no sense...

The docs look good, though.
Flags: needinfo?(kmaglione+bmo)
(In reply to Kris Maglione [:kmag] from comment #5)
> That... makes no sense...
> The docs look good, though.

Hm, it might make sense if Chrome's implementation had a bug, and the behavior they intended was "first non-pinned-index", as the event handling would suggest.

I've opened bug 1388276 for any "index passed to move() is lower than index of the last pinned tab":
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.