The LinkHints modes behave differently in Firefox and Chrome.
vintero1 opened this issue · 2 comments
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
- Google Chrome 130.0.6723.59 (Official Build) (64-bit) (cohort: Stable)
Revision b435ab73731125e60b684a623444b01bbe23aeeb-refs/branch-heads/6723@{#1354}
OS Windows 10 Version 22H2 (Build 19045.4894)
Vimium Version 2.1.2
- Name Firefox
Version 131.0.3
Build ID 20241011205646
OS Windows_NT 10.0 19045
Vimium Version 2.1.2
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.
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! 😉