Skip to Content

Terminal Tips: Force Safari to open all links in new tab

Firefox users have been able to open all links clicked within Firefox in a new tab for a while now, but what about us poor Safari users? Well, sure, you could always hold down command while clicking a link, but that's not fun, now is it? With this simple Terminal hack, you will be surfing like a pro!

Just open Terminal (/Applications/Utilities/) and type in the following command:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

Once you restart Safari, all clicked links will open in a new tab. If you want to reverse the command for some reason, just replace "true" with "false."


Want more tips and tricks like this? Visit TUAW's Mac 101 and Terminal Tips sections.

Categories

Terminal Tips

Firefox users have been able to open all links clicked within Firefox in a new tab for a while now, but what about us poor Safari users?...
 

Add a Comment

*0 / 3000 Character Maximum

21 Comments

Filter by:
Aaron Davies

@Johan S.: you're the reason we can't have nice things.
@Everyone else: the important thing about this is that it overrides evilness like _blank--particularly whatever black magic gmail uses that makes Safari completely ignore tab and command-key settings.

September 08 2008 at 9:56 PM Report abuse rate up rate down Reply
Johan S.

Now you mention it. Is there a reason links on tuaw never have the '_blank' set as target. It's so annoying having to puch back back back or retyping the url.

September 08 2008 at 2:07 PM Report abuse rate up rate down Reply
Will

It will work, but thats not the point, in firefox, using your third button (if you have the 4 button apple mighty mouse then you can set up the scroll ball click function to be the third button) you can open it in a new tab, while left mouse button will do ordinary in-tab open. And using the third mouse button works in safari too, just like in firefox, so if you want the functionality, i would say it would be better to get a mighty mouse for your mac! I wouldn't always want to open links in a new tab, only sometimes, but for people who want to open every link in a new tab, then this would work great.

September 08 2008 at 12:14 PM Report abuse rate up rate down Reply
George

I must be a clutz, but isn't this repeating the same entry as this one:


http://www.tuaw.com/2008/03/21/terminal-tip-safari-3-1-brings-true-one-window-mode/

September 08 2008 at 11:57 AM Report abuse rate up rate down Reply
1 reply to George's comment
Johloemoe

as i posted before... yes ;)

September 08 2008 at 12:53 PM Report abuse rate up rate down Reply
Eimantas

This one doesn't work on Safari 4 developer preview 1.

September 08 2008 at 11:44 AM Report abuse rate up rate down Reply
Manish

Is there a way to open 'new' windows in a new tab? This is a feature that I love in mozilla. Most links open in the same window, but those links that ask the browser to open in a new window actually get opened in a new tab.

September 08 2008 at 11:27 AM Report abuse rate up rate down Reply
1 reply to Manish's comment
cycomachead

thanks what this will do. It's not quite every link. If something is supposed to stay in the same widow, it does or at least that's been my experience.

Try it out for an hour or 2.

September 09 2008 at 9:53 AM Report abuse rate up rate down Reply
Kev Orng

I'd be a happy camper if there was a command-click equivalent in Mobile Safari. Hold down the link for two seconds, get an option to open in a new tab.


September 08 2008 at 11:02 AM Report abuse rate up rate down Reply
2 replies to Kev Orng's comment
ds

Actually, if you Command-click a link, it will open in a new tab (as long as the preferences are set as such).

September 08 2008 at 12:10 PM Report abuse rate up rate down Reply
brian

He said "MOBILE Safari", meaning iPhone/iPod touch. I agree, that's one thing Windows Mobile got right -- click-and-hold = right-click. I *HATE* not being able to open a new page from a link when using my phone.

September 08 2008 at 2:38 PM Report abuse rate up rate down Reply
Big John

OK, so how do I get Mail.app to either make a new tab in the current window or stop popping a new window UNDER my current one?

September 08 2008 at 10:50 AM Report abuse rate up rate down Reply
1 reply to Big John's comment
Johloemoe

You can enable that in the "General"-Tab of the Safari Prefs. "open links from Applications" - click on "in a new tab in the current window"

September 08 2008 at 10:52 AM Report abuse rate up rate down Reply
Johloemoe

Note that this causes strange behaviour in Safari 4 DP. If you click on Links that should create these small undecorated Popups (like Help or something), Safari wont open them in Popups anymore but will resize the whole Window (with your 20 Tabs) and will remove your Address-Bar. The only way to restore Safari then is to close and re-open the window.
Had to disable this feature.

BTW: You had that tip already a few months ago ;)

September 08 2008 at 10:34 AM Report abuse rate up rate down Reply
2 replies to Johloemoe's comment
cycomachead

Thanks. I wanted to mention this too! It is the most annoying thing.

But, you don't have to close the window to get things back. All safari does is reset the window to whatever that site specified. Most of the time there is no bookmarks or URL. To get everything back it's simple.
Hold CMD-Shift and then press | (shift backslash) then B and then T and that will show the address bar book marks and then tabs. Somehow, adding back the address bar and bookmarks makes the tab bar go away.

September 09 2008 at 9:47 AM Report abuse rate up rate down Reply
Levi Figueira

Same thing happened to me! Had to disable as well...
Almost forgot what was causing it and then remembered this mod...

Too bad... At least FF3 is still my main browser and Safari is just for random stuff and testing... :)

September 12 2008 at 3:23 PM Report abuse rate up rate down Reply
brian

Why on God's green Earth would you want EVERY link to open in a new tab? Middle mouse button FTW!

September 08 2008 at 10:29 AM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.