philc / vimium

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

"Link hints" only hints visible links #2420

Open tbena opened 7 years ago

tbena commented 7 years ago

Say there is a page I visit often and I already know there is a link further down with the text "text". I should be able to press f and then text<enter> to follow it using filtered links and I shouldn't need to scroll down the page until it is visible.

smblott-github commented 7 years ago

That sounds likely to confuse more people than it would help.

tbena commented 7 years ago

Can you explain why please? I don't think users who are unaware of this will be affected in any way. They will still choose the link according to the hints visible on screen. What does it matter for them if there are more invisible hints?

Edit: it could always be added as an option.

smblott-github commented 7 years ago

Can you explain why please?

Because I start typing the link's text, and I can see that what I've typed is enough to uniquely identify a hint, but for some reason Vimium isn't picking the hint.

(Because there's another link with the same prefix text out of the viewport.)

Edit: it could always be added as an option.

The bar is pretty high for adding new options. I'm not sure this would be above threshold.

gnarendran commented 7 years ago

For this case, it is possible to use the vimium / search, then hit Esc and then Enter (to open the link in the same page) or Ctrl+Enter (to open it in a background page). Chrome's native search Ctrl+F is even better as it can search across frames, but it doesn't handle regex I believe. On the otherhand, vimium's / does handle regex, but has a limitation that it can't search across frames - one hopes this could be done one day (like f now works across frames)!

damscal commented 2 years ago

I also would highly benefit from the option proposed by the OP @tbena . tbh I would have expected this to be the default behavior, especially when considering web-apps use instead of casual web browsing. Vimium is intended for power users, so I don't see why this option is not included or even changed to be the default... One could always use tab to cycle through filtered links, with the page scrolling accordingly.

The workaround suggested by @gnarendran unfortunately only works for text links, not for buttons, which makes quite limiting in use.

gdh1995 commented 2 years ago

If the expected target to click is unique, then: my customized version of Vimium, named Vimium C (https://github.com/gdh1995/vimium-c), supports a new command of LinkHints.click to select an element and click it directly.

So in Vimium C, map xxx LinkHints.click direct="element" match="div.btn" exclude="[role=menu]" directOptions={"search":"doc","index":"count"} means: