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

By | December 5, 2008

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 com.apple.Safari 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 Comments

Matt on December 6, 2008 at 1:48 am.

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.

paul on December 8, 2008 at 9:45 pm.

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.

David Miller on January 4, 2009 at 4:35 pm.

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 Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail.