How to know when dragging a tab has finished?

荒凉一梦 提交于 2019-12-25 03:53:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!