Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The LinkHints modes behave differently in Firefox and Chrome. #4562

Closed
vintero1 opened this issue Oct 18, 2024 · 2 comments
Closed

The LinkHints modes behave differently in Firefox and Chrome. #4562

vintero1 opened this issue Oct 18, 2024 · 2 comments

Comments

@vintero1
Copy link

Describe the bug
I recently stopped using Chrome and switched to Firefox.
The Vimium extension made this transition seamless though.
But I encountered the inconvenience of switching to the next tab when it's unnecessary. I'll try to explain.

To Reproduce
I have the same custom key mappings in both browsers:

map f LinkHints.activateMode                # Open a link in the current tab
map F LinkHints.activateModeToOpenInNewTab  # Open a link in a new tab
map <a-f> LinkHints.activateModeWithQueue   # Open multiple links in a new tab

# I don't have mapping for this
# LinkHints.activateModeToOpenInNewForegroundTab # Open a link in a new tab & switch to it

So, in Chrome, this behavior is observed:

  • When I press "f" then type a link hint, it opens a selected hint in the current tab.
  • When I press "f" then type a link hint holding SHIFT key, it opens a selected hint in a new tab and without switching to it.
  • When I press "F" then type a link hint, it opens a selected hint in a new tab and without switching to it.
  • When I press "" (aka Alt-f) then type a link hint, it opens the selected hint in a new tab without switching to it. The typed link hint disappears in the main tab, and I can still choose other link hints until I press the ESCAPE key.
  • When I press "F" or "f" and then hold a CTRL key, it opens a selected hint in a new tab with switching to it.

On the other hand, in Firefox:

  • When I press "f" then type a link hint, it opens a selected hint in the current tab.
  • When I press "f" then type a link hint holding SHIFT key, it opens a selected hint in a new tab with switching to it.
  • When I press "F" then type a link hint, it opens a selected hint in a new tab with switching to it.
  • When I press "" (aka Alt-f) then type a link hint, it opens a selected hint in a new tab with switching to it, so I need to return back to main tab.
  • When I press "F" or "f" and then hold a CTRL key, it opens a selected hint in a new tab without switching to it.

What can I do to remain Chrome behaviour in Firefox?

Browsers and Vimium versions

  1. Google Chrome 130.0.6723.59 (Official Build) (64-bit) (cohort: Stable)
    Revision b435ab73731125e60b684a623444b01bbe23aeeb-refs/branch-heads/6723@{Shift+F links open in foreground instead of background #1354}
    OS Windows 10 Version 22H2 (Build 19045.4894)
    Vimium Version 2.1.2
  1. Name Firefox
    Version 131.0.3
    Build ID 20241011205646
    OS Windows_NT 10.0 19045
    Vimium Version 2.1.2
@philg-dev
Copy link

philg-dev commented Nov 9, 2024

For me the behavior in Firefox is exactly as you describe it with Chrome.

I've even just tested it on a fresh Firefox profile with nothing but Vimium installed.

Both F then <hint> as well as f then <SHIFT> + <hint> open the link in a new tab to the right of the active tab, while not switching to the new tab.

Also your mappings for f and F seem to be identical to Vimium's default configuration. Regardless, I have tested with no custom mappings and after adding your custom mappings - both worked the same and both were just fine.

Using your mapping for <a-f> also worked perfectly in my test:
When I hit <a-f> the hints show up and when I type a hint, the respective link opens in a new tab in the background and I can happily type more hints to open multiple tabs until I hit ESC.

When I use <a-f> and then type a hint while holding <SHIFT> it will actually override the current tab, which might be an actual bug. It doesn't open a new tab at all in this case, it behaves like the LinkHints.activateMode action in this case, which seems like a weird "fallback" when using the LinkHints.activateModeWithQueue action. This is probably a very exotic and irrelevant use-case though.

Additional note:
Can you test, if links open in the background when you open them in a new tab via CTRL + Left Mouse Button or Middle Mouse Button? This is built-in Firefox functionality (as you probably know), so it's just a general test if your browser for some reason behaves differently. The expected behavior here would be that CTRL + Left Mouse Button will properly open the link in a new tab in the background.

This browser behavior can be changed with the following property in about:config:

browser.tabs.loadInBackground

The default value should be "true". You should probably check if that's the case for you. If the value is false with bold-print, that would indicate that it's been changed from it's default value for some reason.

P.S.: I have tested setting this flag to false and re-tested some of the use-cases you described and that way I could reproduce the behavior you've described. So I think this property might be the actual culprit in your case.

@vintero1
Copy link
Author

I tested opening links in the background using the CTRL + Left Mouse Button and Middle Mouse Button combinations, and surprisingly, it didn't work exactly as expected at first. However, after changing the 'browser.tabs.loadInBackground' value, everything started working just like it did in Chrome.

Thank you so much for your assistance—it really made my day! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants