5 ms·
They hi-jacked the browser's `/` key to focus the field, which is something I hate. As a user, I want `/` to bring up Firefox's quick search bar, especially whe
by bityard 5y ago
They hi-jacked the browser's `/` key to focus the field, which is something I hate. As a user, I want `/` to bring up Firefox's quick search bar, especially when reading documentation.
They should have just had the search field focused automatically but that would have done away with their "clever" hack to lazy-load the DB containing every page name.
Also, I'm confused, I thought https://mdn.dev/ https://mdn.dev/ was the new thing because Mozilla was stepping back from MDN. Is it a fork? They both carry Mozilla logos, so what's going on there?
- ushakov 5y agoimho, they should've opted for CMD/CTRL + K, which Algolia's Doc search uses > They should have just had the search field auto-focused automatically but that would have done away with their "clever" hack to lazy-load the DB containing every page name. this would steal away the focus and is not good for accessibility (unless you're building a search engine)
- est31 5y agoYeah discourse does the same. Sometimes i want to search within a post for some keyword. But ctrl+f redirects you to the global search... that global search only helps if you want to find interesting posts, but it does not support searching inside one, nor does it allow limited search within a thread. So I started using / in discourse discussions. Then that one was being overridden as well. I've heard the recommendation that you turn js off, which gives you a saner experience.
- mikepurvis 5y agoI hate this behaviour in discourse as well, but it hadn't occurred to me to try using it sans JS altogether, since it seemed to be pretty dependent on it. Will give that a shot for sure.
- polar 5y ago> But ctrl+f redirects you to the global search Press ctrl-f twice.
- est31 5y agoOh thanks for that trick. It violates the principle of least surprise so much but it does what I want. Thanks again!
- chrismorgan 5y agoI sometimes use Ctrl+G (Find Again) to get around sites hijacking / or Ctrl+F when I want to use the browser’s search functionality: if the current search doesn’t match anything or if there is nothing to search for, then it opens the browser’s find bar. If that was hijacked too, you could still focus browser chrome (e.g. Ctrl+L, Ctrl+K, Alt+D and sometimes even others to focus the address/search bar) and then press Ctrl+F.
- Santosh83 5y ago> Also, I'm confused, I thought https://mdn.dev/ https://mdn.dev/ was the new thing because Mozilla was stepping back from MDN. Is it a fork? They both carry Mozilla logos, so what's going on there? It seems to me that mdn.dev is intended to be the future home of MDN web docs since it is collaborative now, and no longer exclusively managed by Mozilla. But they haven't actually made the transition yet, as any link on mdn.dev points back to the old (current) site at developer.mozilla.org
- thrdbndndn 5y agoI knew the existence of "/", but never figure out why I should use this instead of Ctrl+F. What's the difference (other than have fewer features)?
- jannes 5y agoThe only difference I know of is that "/" focuses links. So when you press return, it loads the link instead of jumping to the next result. It's quite nice for keyboard-only web navigation.
- deleted 5y ago[deleted]
- polar 5y ago> "/" focuses links. It's ' to trigger quick find in links only mode.
- kxrm 5y agoI had the same confusion with his comment but I think what he meant was that when you highlight a result in a link, pressing enter causes you to follow that link (which is true). You are correct that ' focuses on only searching within links though. Enter never goes to the next result though, so I am not sure if that is just something different between his setup and mine. I have to use F3 to go to the next result.
- jannes 5y agoWhen I talked about enter going to the next result I was comparing it to the Ctrl+F search bar. Sorry if that wasn't clear. (English is not my first language)
- kxrm 5y agoThis seems to be a good introduction to Quick Find. https://www.tenforums.com/tutorials/120679-enable-disable-quick-find-firefox.html https://www.tenforums.com/tutorials/120679-enable-disable-qu...
- chrismorgan 5y ago> They should have just had the search field focused automatically No, this would be extremely wrong: it’d open on-screen keyboards automatically on platforms that use them, mess with screen readers by dropping them in the search box rather than at the head of the page, and break keyboard functionality, most significantly things like arrow keys and Space for in-page navigation. The autofocus attribute sometimes seems like a good idea, but it’s actually almost never desirable.
- jxcl 5y agoFirefox lets you disable keyboard overrides on a per-site basis, if that's something you're interested in Page Info -> Permissions -> Override Keyboard Shortcuts
- jraph 5y agoGitHub and GitLab do this too. Is there a way to prevent web pages from hijacking this key? I almost never want to use their search engine and when I do, I'm fine with clicking on the input box.
- peterbe 5y ago> They hi-jacked the browser's `/` key to focus the field, which is something I hate. You're not the first one to point it out. Please join github.com/mdn/yari to raise your voice. It's an Open Source project after all. > They should have just had the search field focused automatically Why? There's a lot of JS to load to make that work. If you never need to do a search (e.g. from a Google search) it would be a potential waste. > Also, I'm confused, I thought https://mdn.dev/ https://mdn.dev/ was the new thing because Mozilla was stepping back from MDN. Is it a fork? That domain is just an alias we don't currently use. It's still the old MDN from Mozilla. No fork.
- daleharvey 5y ago> Why? There's a lot of JS to load to make that work. If you never need to do a search (e.g. from a Google search) it would be a potential waste. Confused by what this comment is meant to say exactly, but just in case its not known already, seems this situation is what the autofocus attribute is for @ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att..., no JS needed
- deecewan 5y agothe op is saying "if we autofocussed, we'd need to load all the JS involved in performing the search"
- HWR_14 5y ago> They hi-jacked the browser's `/` key to focus the field, which is something I hate. This is one of the two comments on the article (the other being the rationale as a response for why they used the '/' key to do that behavior.)
- looperhacks 5y agoGreat, even if I wanted to use this, I couldn't. On QWERTZ keyboards, you reach / by pressing Shift+7 which triggers the quick search bar but not the MDN field. Many programs use shortcuts like that and it really sucks.