Target Blank is a Crime

15th of March, 2008

At work last week it was suggested that a set of links should automatically open in a new window — functionality achieved using the anchor property and value target="_blank". The common logic behind this suggestion is well, we want to link to external websites but we don’t want them to leave our website, any web marketer trying to monetise your website will tell you that! My boss is smarter than that, they’re internal links and while he agrees that in 99% of cases target="_blank" sucks, he thinks it’ll create a better experience in this situation. I disagree. There’s no doubt situations out there that suit the opening of a link in a new window but there’s absolutely no situation where it’s appropriate to force it on the user with target="_blank".

To be clear, with the innovation of tabs. The tab equivalent of opening a link in a new window is opening links in a new tab that steals focus. I also understand that there are plugins and options that modify the behaviour of target="_blank" so that instead of opening in a new window, pages are opened in new tabs. For the sake of argument in this post, pretend they don’t exist.

My primary argument is that it is not functionality that a website should be able to control. The browser is the means to view a website, the website should not have control of anything a user is able to control from the client side. Just like a website shouldn’t resize the browser window (although it can), a website shouldn’t be in control of how a new link is opened, that’s the user’s domain.

Then we come to expected behaviour. Years of using something like a computer creates a feeling of expected behaviour in users. When you move the mouse to the upper right, you expect the cursor to do the same, when you press the “R” key you expect the letter R to appear on your screen. Taking advantage of expected behaviour is part of what makes great user interfaces great. OS X tends to be a more pleasant operating system to work in because of interface guidelines that keep behaviour and style consistent across all applications. App preferences is always expected to be under the app menu and it’s keyboard shortcut is expected to be command+comma, if it’s not users are annoyed. That keyboard shortcut or menu position may not be ideal on an individual app basis but it is ideal in a context where users are operating many applications a day that all mirror the same behaviour for common tasks.

The expected behaviour when clicking a link on a website is to be forwarded to that link inside your current window. If you’re in a situation where you’d rather have that link open in a new window or new tab, you can modify it’s behaviour by right clicking and choosing the appropriate option or by holding a modifier key like command or control while clicking. Command/control clicking to open in a new tab/window is also expected behaviour.

There are often situations where I use this behaviour. When browsing a website full of good links like Daring Fireball I’ll command click them to force them into new background tabs so I can continue reading and continue opening links in background tabs for reading once I’ve finished at Daring Fireball. I imagine many users browse in the same way. It may appear to be a case for target="_blank" but it is not. Primarily because target="_blank" is not able to open links in background tabs, rather it opens links in new windows that steal the focus from the window you were reading effectively creating the same situation as if the link behaved expectedly and loaded the new page inline. Focus is lost from the page in both situations, access back to the page you were on is one click away — the close button or the back button — except it creates the debris of an extra window and control of the browser’s behaviour has been hijacked.

Users that wanted the expected behaviour are annoyed and users that did want the link open in a new window won’t feel a burden lifted from their shoulders because they didn’t have to hold a modifier key with an otherwise idle hand while they clicked — an action that comes almost as naturally as right clicking.

Don’t assume you know better than your users when it comes to ingrained expected behaviour. If they want a link opened in a new window, they will command click or select the option from a contextual menu. If they don’t want it opened in a new window they’ll click without a modifier like normal and expect normal behaviour.

If you think it’s too much to ask users to hold a key every click in a situation where you imagine they’ll always want the link open in a new window consider characters like &, % and @ which require modifier keys to type. Would you prefer the application to consider the context and then decide that when you type a “3″ what you really want is a “#” with no way to change that behaviour?

target="_blank" is never a good idea.