otzbergnet/wbmExtension

[Discuss] new tab to be positioned after current tab?

gingerbeardman opened this issue · 2 comments

Currently this extension adds tab to the far right position.

I seem to remember my extension added a tab next to the the tab where the WBM action was taken. This was a much nicer experience

Sadly, I have no idea how to do that :(

Basically the openTab function is defined as opening a tab at the end of the tab. In TabCount - closing to left and right is achieved by getting all tabs, identifying index and then closing anything before the index or after.

However there is no function to open a tab at the specific location.

When you get all tabs the array that is returned is immutable.

I don't see any ordering functions available to me that I could use.

I had a quick try what would happen, if I tried to "open" the tab through JavaScript and it blocks the popup (for all the right reasons).

So long story short, it ain't easy and I have a mental block how to get it done. I did however reach out to Jeff Johnson on Twitter - to hear his thoughts. It might be easy and I just can't see it.

I am going to close this, not because I don't agree it would be useful, but since there doesn't seem to be an easy-ish way to accomplish it. I heard back from Jeff, who had once posted an Apple Script, how to do it, and he said, he didn't know how to do it in an Safari App Extension.

We might be able to take it back up, when more folk contribute to the code?