sblask-webextensions / webextension-open-tabs-next-to-current

Open new tabs to the right of the current one.
https://addons.mozilla.org/firefox/addon/open-tabs-next-to-current/
MIT License
162 stars 21 forks source link

Tabs are placed respecting opening order #36

Closed averissimo closed 7 years ago

averissimo commented 7 years ago

It would be cool to have the tabs placement in the order they were opened from a window.

Example:

  1. Click to open link in new tab (Tab1), which opens a new tab right to Tab1 (lets call it T2)
  2. Without switching tabs - open a link in a new tab that should open right of Tab2

The idea is to respect the opening order of the tabs.

I would guess a temporary variable (cleaned on each tab switch) would have to be kept with the id of the latest tab opened from current tab, so that the next one would open to the right.

On the other hand, this might increase the complexity and I'm used to another addon and need to adapt to this one :)

ps. thanks for the addon, it comes to fill the void of one of tab mix plus features!

averissimo commented 7 years ago

Use case

Navigating to this web page http://web.stanford.edu/~boyd/papers/admm/

I would like to open the three first examples and the expectation would be that the order of the tabs next to the current would be the 1. 2. and 3.

sblask commented 7 years ago

I don't think you need this extension, browser.tabs.insertRelatedAfterCurrent in about:config should do what you want.

averissimo commented 7 years ago

the two together are gold!! thanks :)

monk-time commented 6 years ago

@sblask I don't think that's correct. According to this (and I can confirm this by testing in FF57), browser.tabs.insertRelatedAfterCurrent can be set to false to make links opened from the same tab to open at the end of the tab bar, like it used to work pre-3.6 almost 8 years ago. By default it makes such tabs (but not empty tabs or bookmarks etc.) open next to the current tab in the order of opening, just like the OP wants.

Open Tabs Next to Current overrides this setting, which makes total sense because they overlap: the former applies to all tabs and the latter only to "related tabs", which I assume means only links opened from a current page.

But the extension also breaks the default Firefox behavior re: tab order, and I've noticed some misunderstanding about this in a couple of places (e.g. #40, #33). Here's how this setting and your extension modify new tab placement:


"a b c" are the current opened tabs with "a" being the current tab. "1 2 3" are the new tabs opened in that order

browser.tabs.insertRelatedAfterCurrent Links opened from the current tab New blank tabs or history/bookmarks/search/entered urls opened as new tabs*
true (by default) a 1 2 3 b c a b c 1 2 3
false a b c 1 2 3 a b c 1 2 3
true (by default) + WebExt a 3 2 1 b c a 3 2 1 b c
false + WebExt a 3 2 1 b c a 3 2 1 b c

*: either through middle click, ctrl+click, a context menu option or with alt+enter (for entered urls), browser.tabs.loadBookmarksInTabs (for bookmarks) and browser.search.openintab (for search) enabled


I agree with a comment in another issue that the order should be configurable through the extension settings, with the default being how Firefox handles tabs opened from the same tab by default (1 2 3). I don't know WE APIs, but it should be possible to track all such tabs and shift their position until the user makes another tab active. And there is such an option in a similar webextension Tab Open/Close Control

Could you please re-open this issue? The wrong ordering can break user workflow in multiple subtle ways.

sblask commented 6 years ago

Things have recently changed and the combination of setting and extension doesn't do what it used to do. The extension now always opens tabs right to the current tab. This is the way it should be and what it did before was due to a hack that I could remove.

monk-time commented 6 years ago

This is the way it should be

In that case I'll have to switch to Tab Open/Close Control. I do think most Firefox users of your extension just want to extend the default browser behavior from the first column to the second (i.e. "a 1 2 3 b c" instead of "a b c 1 2 3" for blank tabs/etc.), not expecting the order to change to "a 3 2 1 b c".

sblask commented 6 years ago

That's cool, if there is an extension that does what you want, go for it. I don't use Firefox anymore because its defaults are totally unusable for me and the extensions that fixed my major problems do not work anymore.