philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.21k stars 2.48k forks source link

Using map to open new tab and switch to that will open new window instead #3077

Open jkonecny12 opened 6 years ago

jkonecny12 commented 6 years ago

Using this custom mapping:

map F LinkHints.activateModeToOpenInNewForegroundTab

won't work as expected. Instead of showing a tab and switching to it, it will open a new window.

This is happening on Vivaldi browser.

pat-s commented 4 years ago

Still valid.

gdh1995 commented 4 years ago

This is because Vivaldi changes (switches) the default actions of Ctrl+Shift+Click and Shift+Click, while Vimium doesn't know it and still simulates Click with Ctrl+Shift

debiedowner commented 3 years ago

So apparently the behavior is as follows:

Chrome Vivaldi
Ctrl+Click Open link in new background tab Open link in new background tab
Shift+Click Open link in new window Open link in new foreground tab
Ctrl+Shift+Click Open link in new foreground tab Open link in new window

Personally I prefer Vivaldi's behavior (I normally open in either background or foreground tabs, almost never in new windows). Short of an option to change modifier keys or a Vivaldi-specific fix (Vivaldi's user share among vimium users might not be enough to warrant that), a new unbinded advanced command LinkHints.activateModeToOpenInNewWindow that Shift+clicks would provide a useful workaround. Chrome users would then get a new feature to open links in new windows if they like, and Vivaldi users can have access to normal functionality by swapping LinkHints.activateModeToOpenInNewWindow and LinkHints.activateModeToOpenInNewForegroundTab. In fact, I was surprised to see that LinkHints.activateModeToOpenInNewWindow wasn't already available as it sounds like it would be a trivial extension of current functionality.

coordinatio commented 1 year ago

The solution to the request is to use newtab="window" option for the LinkHints like this:

map J LinkHints.activateOpenInNewForegroundTab newtab="window"

Taken from here. Works with the recent Vimium-C and Vivaldi.

victorlin commented 8 months ago

What is LinkHints.activateModeToOpenInNewForegroundTab? I only see LinkHints.activateOpenInNewForegroundTab as an option.

This works for me on Vimium-C 1.99.99 and Vivaldi 6.5.3206.59:

map F LinkHints.activateOpenInNewForegroundTab

EDIT: Sorry, I thought this was the Vimium-C repo. Now I see that the command names are slightly different.

gdh1995 commented 8 months ago

Um, in fact I recommend users of Vimium C to try map f LinkHints.activateOpenInNewForegroundTab ctrlShiftForWindow, which is designed to directly fix the behavior on Vivaldi.

BTW, LinkHints.activateModeToOpenInNewForegroundTab should also work in Vimium C - it works as an alias of LinkHints.activateOpenInNewForegroundTab.

guest73 commented 5 months ago

This is still open? Apparently. It did not work for me either. But since I open and switch to the tab immediately 99.9%, I simply installed Activate Tab plugin, and now my F opens a tab and switches to it.

AllanHigdon commented 1 month ago

Um, in fact I recommend users of Vimium C to try map f LinkHints.activateOpenInNewForegroundTab ctrlShiftForWindow, which is designed to directly fix the behavior on Vivaldi.

Vivaldi is my default browser. I've been using the Surfingkeys extension for a couple of years or so. I decided to switch because of Manifest v3. There is a warning message displayed with Surfingkeys now. This works great with the latest Vivaldi Snapshot and Vimium C.