Workaround for "Tabs cannot be edited right now"

183 views
Skip to first unread message

Gaurang Tandon

unread,
Sep 11, 2024, 7:49:58 AMSep 11
to Chromium Extensions
Hi! I noticed recently that chrome.tabs.create({ url: 'some-url' }) will fail if at that time the user is holding down on a tab in the tab strip with their mouse (and optionally dragging it around). The error is: "Tabs cannot be edited right now (user may be dragging a tab)."
 
I can either keep retrying for 5-10 seconds until user stops holding/dragging. Or I can send a message to my offscreen document and have it call window.open(url) - which seems to open a new tab correctly.

I'm not sure which approach is better and if there's any hidden issues with either (that may be platform specific). So I'm posting on the group to get some guidance.

Best,
Gaurang
Reply all
Reply to author
Forward
0 new messages