I don't know if this is the same in all browsers, Firefox has this feature where it cycles through your tabs in a "smart" way. Specifically, consider this sequence of events:
- You're on Tab1. You create a new tab via
right click -> Open Link in New Tab
. - You create another tab via
right click -> Open Link in New Tab
. - You activate New Tab #1.
- You close the current tab.
- Firefox automatically activates New Tab #2.
The problem is that this doesn't happen if the tabs were created with tabs.create
. On step 5, Firefox will activate Tab1 instead of New Tab #2.
I've tried to set openerTabId
and index
, but to no avail:
await browser.tabs.create({
url: 'http://example.com',
active: false,
index: openerTab.index + 1,
openerTabId: openerTab.id,
});
await browser.tabs.create({
url: 'http://example.com',
active: false,
index: openerTab.index + 2,
openerTabId: openerTab.id,
});
Is there a way to get the same behavior as Open Link in New Tab
?