danielnixon / link-fixer

Restores consistent ctrl+click, shift+click, cmd+click and middle-click behaviour when clicking links.
MIT License
55 stars 7 forks source link

Tab order in Chrome for new inactive tab should follow the active tab #479

Open jabagawee opened 1 year ago

jabagawee commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Use Google Chrome and this extension.
  2. Control click links that would normally open in the current page due to JavaScript shenanigans.

Expected behavior Tabs open to the right of the current, active tab. Tabs are associated with the proper openerTabId.

Actual behavior Tabs open at the end of the tab list. Tabs are not associated with the proper openerTabId.

Browser (please complete the following information):

Additional context Probably want to look at the following links:

danielnixon commented 1 year ago

Duplicate of https://github.com/danielnixon/link-fixer/issues/13 ?

danielnixon commented 1 year ago

This add-on will respect the value of Firefox's newTabPosition if it's available. If it's not available, this add-on will fall back on relatedAfterCurrent, which happens to be the default value of that setting. There is no such equivalent setting available in Chrome that is exposed to add-on authors (that I'm aware of). I recommend you use Firefox (for all sorts of reasons).

If we added an add-on setting for this value, it would work everywhere (including Chrome and earlier versions of Firefox).

What you're asking for is essentially for the default to change from relatedAfterCurrent to atEnd.

I'm not going to change the default, but I would gratefully accept a PR (in https://github.com/danielnixon/link-fixer/issues/13) that adds a user setting to this add-on.

For now I'll close this as a dupe of https://github.com/danielnixon/link-fixer/issues/13 and update the description on https://github.com/danielnixon/link-fixer/issues/13.

danielnixon commented 1 year ago

Oh my apologies, I think I misinterpreted and got your expected and actual switched around in my mind. In which case maybe there's an issue in my relatedAfterCurrent impl in Chrome. Hmm.

zznidar commented 1 year ago

After testing the patch in #502, I realised that passing index: undefined in Chrome fixes this issue as well (tabs are opened at the same position as when no addon is used).

(in testing, I've manually set the new isFirefox var to true, which is equivalent to always passing index: undefined)

@danielnixon if so, I think that the calculateNewTabIndex function actually does nothing useful – in such case, it could be removed and the index value hard-coded to undefined?

erickhavel commented 11 months ago

Any progress on this?

Mac & Firefox user here. I found the extension and love it but #58 was driving me nuts. I "fixed" it as per the first proposed solution (to comment out the openerTabId line), which solved the tab closing issue. But then I noticed that tabs weren't opening immediately to the right of the current one anymore.... so I tried this latest solution to instead set index to undefined and it seems to have solved both issues!