问题
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?
回答1:
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);
.
来源:https://stackoverflow.com/questions/25460665/how-to-know-when-dragging-a-tab-has-finished