4 ms·
What is the correct way to force a link to open in a new tab, then? Unfortunately "let the user decide" is not the best answer if you want to link to something
by Dru89 10y ago
What is the correct way to force a link to open in a new tab, then?
Unfortunately "let the user decide" is not the best answer if you want to link to something like "terms and conditions" in the middle of a sign up flow or something. If the user doesn't know how to open it in a new tab on their own, this can be extremely frustrating I'd imagine.
- illuna 10y agoLinking to stuff that you control is okay, because you know and control the contents inside the new window. So your example (terms and conditions created by you) is totally cool. As described in the article, it is dangerous when the link's destination is not controlled by you. That destination has access to its opener's window and could potentially change the url to eg. a malicious look-alike of your site. It's a consideration when linking to arbitrary pages, but when you own the destination (and trust that your site has no other security issues) then this becomes a non-issue.
- pmalynin 10y agoThis is one of the reasons why FB et al go to a special link before opening the actual target site.
- hueving 10y agoThat's more of a happy accident. Their primary reason is to track things.
- wtbob 10y ago> What is the correct way to force a link to open in a new tab, then? What is the correct way to stalk, hunt, kill, stuff and mount the user? Answer: there is no correct way to do something which is fundamentally incorrect. > Unfortunately "let the user decide" is not the best answer if you want to link to something like "terms and conditions" in the middle of a sign up flow or something. If the user doesn't know how to open it in a new tab on their own, this can be extremely frustrating I'd imagine. Abusing my browser is extremely frustrating for me. If I want to open a link (a link, see, not some horrid piece of JavaScript) in a different tab, I middle-click and get on with life. You don't need to do that for me, any more than you need to offer me a typing widget when I have a perfectly functional keyboard, or fake a link when I have a browser perfectly capable of understand the <a> tag, or check my (correct) email address with an incorrect regular expression. Please don't break the Internet.
- douche 10y agoOn the other hand, I almost never want to have a link open in the same tab. There's nothing more frustrating than being halfway down a page, forget to hold down ctrl when I click on a link, and have all of my state on the old page blown away and replaced with the new one. Probably this is a result of the internet already being broken, since the worst of it is in infite-scrolling type things where my confidence that I can get back to where I was originally after going back is very, very low.
- MichaelApproved 10y agoIf you have a middle mouse button, you can middle click a link to open it in a new tab. Of course, that's if you didn't reprogram the middle button to do something else.
- azazqadir 10y ago>> If the user doesn't know how to open it in a new tab on their own, this can be extremely frustrating I'd imagine. Is there any internet user who doesn't know how to open in new tab? Just curious to what type of users they would be.