Force Safari to open targeted links in a new tab, instead of a new window

There is one feature in Firefox that I’ve always wished Safari had. The ability to always force targeted links (those that would normally open a new browser window) to open a new tab.

For example, if you’re viewing this in Safari and you click this link, it will open a new browser window taking you to Google. I would rather it open in a new tab instead. You can temporarily do this on a link-by-link basis by holding down the Command key when clicking the link, but I want it to work that way all the time.

Fortunately, this feature is already built into Safari (at least on the Mac), but it’s turned off by default. In order to turn it on, all you need to do is paste the following command in to the Terminal (quit Safari first):

defaults write TargetedClicksCreateTabs -bool true

That’s it. Safari should now open all links that would have opened a new window, in a new tab instead. If you want to turn this feature off, paste the same command, but replace the word “true” with “false”.

Thank you Roger Johansson!

3 thoughts on “Force Safari to open targeted links in a new tab, instead of a new window”

  1. This is a great tip and one that I have been using for about a year now. I can’t tell you how much easier it makes using Safari when everything opens by default in a tab.

    Just like this, for me, it’s all about the Safari plug-ins that let me customize the browser to be more like Firefox. I like using ad block software (Safari AdBlock), instant web search (Inquisitor), and CoolIris (awesome Flickr viewer), plus a few others. I might use Firefox more, but I love how my Safari bookmarks sync with my iPhone. I wrote an article called Bring Firefox Functionality to Safari that shows you how to do all of this. It’s worth a quick read.

  2. Matt – Excellent post. I use Stand and Inquisitor already, but I may have to give DeliciousSafari a try. Thanks for sharing.

    I am always a little worried about relying on plugins, as it’s possible they may all stop working, since Apple doesn’t even try to support them.

  3. Awesome – works just like you said it would ;o)

    Just out of curiousity – can this only be done from the command prompt or is there a GUI method too?

    Thanks for shedding the light and Happy New Year! ;o)

Leave a Comment