0

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:

  1. You're on Tab1. You create a new tab via right click -> Open Link in New Tab.
  2. You create another tab via right click -> Open Link in New Tab.
  3. You activate New Tab #1.
  4. You close the current tab.
  5. 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?

Aran-Fey
  • 39,665
  • 11
  • 104
  • 149

0 Answers0