Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Firefox has a neat trick to only search in links. Press ' (single-quote) and at the bottom, a text input field appears with the hint "Quick find (links only)". Type two or three characters will focus the link in question, just press enter to navigate.


This used to pair nicely with "/" which opens up the normal quick search. Unfortunately this is broken on the "modern" web as many web pages "helpfully" override the "/" key to make it go to their search box which, of course, is not at all what that key should do. There doesn't seem to be any way to stop web pages stealing this key and I've slowly learnt to use the comparatively clumsy "Ctrl+F" instead as I'm too scared to try "/" now.


> Unfortunately this is broken on the "modern" web as many web pages "helpfully" override the "/" key

Argh this kind of thing makes me really cross. So many sites seem to feel the need to reimplement things that are already part of most browsers or even in the spec. It's not just overridng default shortcuts, but custom context/rightclick menus, custom 'links' (where clicking them runs javascript code to window.open, instead of being a real link), custom form fields that advertise 'excellent accessibility', where the fields would have been accessible anyway if they didn't decide to reimplement them, disabling text selection, overriding focus styles because the accessible styles 'look ugly' ... the 'modern' web is pain.

Anyway, this wasn't going to be a rant. My point was going to be that consistency is key. Your comment on '"Ctrl+F" instead as I'm too scared to try "/" now' really resonated with me, because I've thought about this before. I've found that a feature or shortcut is only useful if it's consistent. I can't build muscle memory or be confident using a feature if it only works 90% of the time. Or even 99%.

I've tried tridacyl and other vim-style plugins for browsers several times in the past, but always end up uninstalling them in disappointment, because it's not possible to have a consistent experience. 99% of the time it works perfectly, but then there are the handful of sites or browser specific pages (eg. about: or view-source:) where it doesn't work at all, or doesn't work consistently so one must disable it. Then muscle memory totally breaks; you need to learn two sets of keybindings for the same context, and that introduces a hesitation for every keypress, which kills speed and enjoyment.


I mostly agree, but every now and then there is actually a good reason to override/re-implement them. For example, let us say you are using virtualized components [0], so all available elements have not necessarily been rendered to the DOM (making Control-F useless).

[0] - https://github.com/bvaughn/react-virtualized


I would still argue in these cases that the site shouldn't override the built-in keybinds. Maybe a custom search field/button, and maybe a custom keybind. But when I press Ctrl+F, I always want the same type of search to be initiated. Otherwise, there is no consistency, and efficiency suffers.


I’ve always had in mind “you can’t have simplicity without consistency”. Applies to user interfaces, code structure, and APIs as well.

The more consistent something is, the less you have to remember. But it can be really hard to do things consistently for various reasons.


Special mentions to the github actions log output, which not only overrides ctrl+f with their own search, but have a completely broken search. Which means logs are unsearchable. Thanks a lot.


Unless they're doing something wonky like hiding content that is not in the viewport (thus reimplementing scrolling), you may be able to work around that by using ctrl-f from the URL bar, denying them the opportunity to hijack ctrl-f. So ctrl-l ctrl-f.


A Firefox extension I want (or maybe I'll make one day) would be one that prevents javascript from detecting any key input while holding right ctrl or left ctrl specifically.


Does it open the browser search if you press ^F a second time?


I wasn't even aware / was for quick search. I always used Ctrl+F, which is incidentally much easier on my localized keyboard. But trying it right now, I notice that / and Ctrl+F opens different dialogs? One is called "Quick Find", the other "Find in Page", with the latter offering additional options, even though both seem to do the same thing? What is up with that?


Not sure if it's a feature or not, but setting the page permissions for "Override keyboard shortcuts" still allows '/' to work, but will disable 'esc' for closing the search modal/popout - and as '/' is a keyboard shortcut, I have no idea why it still lets the site take it over


Heck, MDN themselves is even guilty of this. It's maddening.

https://news.ycombinator.com/item?id=28051562


Discovered this when some vim-like plugin failed. Realized it's about 90% of the reason I was using a vim-like plugin.


I just tried using it when I realized I couldn't upvote your comment as the link has no text.

Back to vimium.


Slightly more involved, but still serviceable:

- start typing the text on a link near the icon you want to click (for this comment, `thomasa`...)

- then press Shift+Tab to highlight the previous link


Vimperator provided an incredible Vim-like experience for Firefox.

Sadly, the transition to a new plugin architecture killed it and Tridactyl doesn't come even close. Some things are not possible with the new Firefox APIs, and many websites steal keyboard focus thereby ruining the Vim-like experience. Really frustrating.


What do you think of Vimium for Chrome? There's also a Firefox port: https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/


I ditched my vim-like plugin when I realized I could ctrl-f, ctrl-enter to follow links in chrome.


Thanks, this is awesome. I totally expect to rely on this feature after using it for a few weeks and expect Mozilla to yank it out for usability reasons.


I'm using the US International keyboard mapping, to type ' I have to type ' + space. The goal is to add the possibility to wrote letters like é (' + e).

So this doesn't work for me and it doesn't seem possible to change the shortcut on Firefox :(


So I use a keyboard layout (Irish) from a country where this a need some people have but not frequently. There is the compose feature, but it's located in the button underneath escape (labelled ` ¬ ¦), not overloading single quote.

The one issue with that arrangement is you run into video game server admin/modding tutorials and the like and they describe pressing "~" for the console, and it's hardcoded to the keycode and doesn't consider the keymap, so it's actually looking for that button, except getting a literal ` requires a double tap of ` rather than all the UI elements telling you it's ~.

Oh and quoting code blocks in markdown can be kind of annoying. Or inline variable names that start with a letter that supports the accent.

But I think I'd take those limitations over losing single quote.


ctrl-shift will switch back and forth between selected keyboards in windows, so you can keep the keyboard in ENG US most of the time (allowing you to use the ' shortcut in Firefox), and use ctrl-shift to switch to ENG INTL when needed.


There's a variant of the US layout called altgr-intl where instead of making ' a dead key you can do RightAlt-e for é.


Is that literally the same character for both? On my layout `e leads to è whereas alt-gr+e = é. é != è in many languages.


janus24 specified "é (' + e)". That's neither ` nor è.

Not all languages that use é have a use for è.


Wow! One more reason to stick with Firefox. Thanks!


Thank you so much for this. Used it since more or less day one and never knew about this feature.


I so forgot about this. Incredible.


Wow, TIL. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: