Daniel Hilgarth
Daniel Hilgarth

Reputation: 174309

How to know when dragging a tab has finished?

I am building a Chrome extension that moves my pinned tabs to the active window: http://screencast.com/t/bRroTVda

It works great, with one exception: When switching to another Chrome window by clicking on a tab in that window, I can't use chrome.tabs.move to move my pinned tabs to the newly activated window. runtime.lastError in the callback says

Tabs cannot be edited right now (user may be dragging a tab)

My problem now is: There seems to be no event that I can subscribe to that is raised when the user stops dragging.

What are my options?

Upvotes: 0

Views: 535

Answers (1)

Rob W
Rob W

Reputation: 348992

You could retry moving tabs until the error goes away. To rate-limit the number of calls to 10 per second, use setTimeout(yourFunctionThatCallsChromeTabsMove, 100);.

Upvotes: 1

Related Questions