6 ms·
This site doesn't use links so it is very frustrating to use. I was trying to middle click to open new tabs but it didn't work because they aren't <a> tags.
by kevincox 7y ago
This site doesn't use links so it is very frustrating to use. I was trying to middle click to open new tabs but it didn't work because they aren't <a> tags.
- pier25 7y agoSadly that's a common problem with single-page apps and modern web front end. It's trivial to implement but many devs don't pay attention to those things.
- kevincox 7y agoPeople underestimate the value in functionality and consistency that native interfaces provide. It is also partially the web's fault. There isn't an easy way to detect an "in-page" navigation. The best solution I am aware of is: 1. Add global "click" listener. 2. Check that the click target was an `a` tag. 3. Check that the click was a single left click with no modifiers. 4. Check that the `href` points to a page that you can render. 5. Call event.preventDefault() and handle the navigation yourself. But step 3 isn't even sufficient as people can configure their browsers to open all links in new windows or tabs.
- pier25 7y ago> But step 3 isn't even sufficient as people can configure their browsers to open all links in new windows or tabs. You know many people that do that? I do that for search results and Reddit but I don't want that behavior for all websites.
- kevincox 7y agoI don't know about many but I do something similar. I make all links open in the same tab. Then if I want another tab I can middle click. This way I can decide where links open, not the website owner.
- quambene 7y agoAnd even more importantly, external content should always be a link instead of a button. If it's a button, you can't see where you are going which is a poor user experience and security issue. Other than that, neat idea.