Open new related tabs next to current tab in most recently opened order
I've been trying to decipher browser.tabs.insertXXX with little success. What I want to achieve is to open tabs from the same site next to the current tab with the most recently opened tab next to the original tab.
Example Two tabs are open, site 1 tab 1 and site 2 tab 1. Open a new link to site 1 on site 1 tab 1. The order is site 1 tab 1, site 1 tab 2, site 2 tab1. Open another link to site 1 on site 1 tab 1. The order is now site 1 tab 1, site 1 tab 3, site 1 tab 2, site 2 tab 1.
Thanks in advance.