7 ms·
Sidenote: please don't hijack CTRL+F on webpages, thanks. Sincerely, the world.
by RedShift1 2y ago
Sidenote: please don't hijack CTRL+F on webpages, thanks. Sincerely, the world.
- deleted 2y ago[deleted]
- jeroenhd 2y agoSometimes they "need" to, because rather than load 100kB of text, they'll chunk 100kB of text over ten JSON requests and searching requires backend intervention. If you make every web page an app, the browser doesn't work right anymore so you force yourself to build a browser within a browser!
- 0xTJ 2y agoEven if it's for that, it's infuriating, and a terrible pattern. Just as I expect CTRL+click to open in a new tab, there are some interactions that should be left alone; it's annoying to me that they even can be overridden.
- ants_everywhere 2y agoCtrl-F should search the loaded page using the browser's search settings so that the user can have a consistent interface. If sites choose not to load the page all at once they can provide another search bar with a different experience. But that's not the Ctrl-F search.
- TrianguloY 2y agoI've seen that on pages with text editors that don't load all the text or where search is expanded with more features, like for example on Github. In these cases I usually click outside the editor and then control+f works as usual. If not, you can also try F3, and if that's hijacked too browsers usually have a shortcut to "find in page" in the hamburguer/three-dots menu
- klez 2y agoAnd `/` neither, while you're at it (I'm looking at you, GitHub).
- SushiHippie 2y agoThey have a (broken) setting under the accessibility settings which disables all the character key hijacking. https://github.com/settings/accessibility https://github.com/settings/accessibility But for whatever reason this only seems to work temporarily (if it is already toggled off for you, you need to enable it again, save preferences, then toggle it off, and save preferences) and then it does not hijack '/' for a few minutes.
- klez 2y agoBut even then I shouldn't need to do it for every website that does this.
- rty32 2y agoFound the vimmer
- klez 2y agoIndeed :)
- mmcdermott 2y agoTrue, but `/` is also a shortcut for quick find in Firefox.
- homebrewer 2y agoAnd ' searches through the links only. Find a link, press enter (or shift+enter) and you don't have to touch the mouse or install vimium and friends.
- Karellen 2y agoOr just anyone who uses `more` or `less` or almost any other pager.
- throw101010 2y agoSmall tip, and I know it doesn't make it much better, but in few cases I've seen this done (Discourse is the main culprit and it's widely used) pressing Ctrl+F a second time will go to the normal browser "Search in this page" function. Still annoying, but manageable.
- dspillett 2y ago[for those just reading the comments having not read TFA: it isn't talking about changing default find behaviour within a page, but the feature to specify text to scroll to and highlight within a link URL so the user doesn't need to ctrl-F when you refer to a small part of a larger page]
- amadeuspagel 2y agoPlease don't hijack HN threads with unrelated gripes about the modern the web and please don't pretend to speak for the world.
- RedShift1 2y agoUnrelated? CTRL+F is literally in the title...
- wkjagt 2y agoIt is. But the article doesn't talk about hijacking its behaviour.
- lolinder 2y agoAnd only in the title. It doesn't mention the keyboard shortcut once in the body because it's not about keyboard shortcuts, it's about "linking directly to web page content". In addition to unrelated gripes, it's generally considered bad practice to comment only based on the title.
- deleted 2y ago[deleted]
- klabb3 2y agoI have to agree. Normally I think related side notes are fine. Heck, I’m guilty myself. But nowadays I always open the link first to make sure it's the right topic and to make sure it’s not addressed in the article. Often leads to a better response as well. Yes, we know scroll-jacking or any other override of browser behavior is extremely disliked here.
- arusahni 2y agoHijacking CTRL+K sucks, too! It's the shortcut used to focus the browser search input in Firefox, but the industry has seemingly decided it's a great way to launch a command palette.
- egeozcan 2y agoI recently implemented this, and the users loved it, though I was disappointed to hear it may have frustrated a usually silent group. I'm open to feedback! What would be a better approach? Please don’t just suggest “no custom shortcuts for any web app”—people spend 60-70% of their workday using the UI components my team maintains. While random sites hijacking shortcuts is definitely frustrating, in our case, the pros seem to outweigh the cons. Maybe allowing users to disable or customize shortcuts could be a solution? Or would that be over-engineering? Honestly, I think the web platform could use a standard API for defining shortcuts, with browsers providing a UI to manage or disable them. Maybe I'm still over-engineering here. Would really appreciate hearing others’ thoughts!
- lolinder 2y ago> I was disappointed to hear it may have frustrated a usually silent group. This group isn't usually silent (far from it), they're just not usually your users. If you're building a web app a la Notion, Figma, Google Docs, Slack, or anything similar: just ignore the "the web should just be documents that strictly use the platform" complaints. Ensure you build in the required accessibility hooks (since those don't come natively to most custom work), but your users will thank you for accommodating their specific needs better than the platform does. If you're building a web page that mostly presents information... yeah, maybe listen to the people here. The main thing you're seeing here is that there's a subset of developers who haven't ever really liked the idea that the web became the primary means of deploying applications.
- cpmsmith 2y agoThe "press again to fall back to the browser's key binding" solution many sites use for ^F isn't perfect, and won't work for all scenarios, but it definitely helps.
- wkjagt 2y agoInteresting that this is the top comment at the time I'm reading this, while the article isn't at all about hijacking CTRL+F.
- n_plus_1_acc 2y agoThat's why it's prefaced with "sidenote"
- deleted 2y ago[deleted]
- xp84 2y agoMaybe this is a hot take then, but I think most sites I've seen that do this, are surprisingly good at doing their One Job correctly such that I haven't resented it the way I resent things like overridden context menus, links that are not really links, etc. e.g. GitHub. If I'm on a source file and I hit Ctrl-F, yes, in fact I do want to search the source code and not GitHub's UI -- and their search bar for that purpose is delightfully simple and not distractingly different than the normal search I expected to see when I hit that key. What would make me rage throw my computer through a window would be if I hit Ctrl-F and it loaded a full-screen modal which showed a search results page of result snippets or something. So I'm impressed with the restraint shown by the front-end developers (or their "UX designer" taskmasters) in this case.
- taco_emoji 2y agoSometimes it's fine if a page is lazy-loading content, in which the browser's CTRL+F does not work because the text isn't all in the DOM at that moment.
- deleted 2y ago[deleted]