Filed under: Terminal Tips
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
Want more tips and tricks like this? Visit TUAW's Mac 101 and Terminal Tips sections.

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 2)
pete-01 said 10:17AM on 9-08-2008
I am always hesitant to make these kind of preference changes, because, if I ever want to go back, i have to remember the changes i made. (at least that is the impression i am under.) is there a way to reset these changes?
on another note, you could really mess with someone changing their defaults. imagine safari only opening links in new tabs and not knowing how to fix it.
Reply
Cycomachead said 9:49AM on 9-09-2008
Yes there's a couple things:
1. in terminal you could hit the up key until this string came back up. It might not be as useful if you live in terminal though.
2. you can delete the com.Apple.Safari.plist file in your preferences folder.
Jake said 10:17AM on 9-08-2008
Oh great presents of Monday morning. This _was_ the only reason I installed SafariStand with much grumbling.
Reply
peter.boysen said 11:01AM on 9-08-2008
This one is a good one. I'm glad you brought it up. (I just recently switched back to Safari, and I remember feeling somewhat put off by the absence of this feature).
Reply
brian said 10:29AM on 9-08-2008
Why on God's green Earth would you want EVERY link to open in a new tab? Middle mouse button FTW!
Reply
Johloemoe said 10:38AM on 9-08-2008
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 ;)
Reply
Cycomachead said 9:47AM on 9-09-2008
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.
Levi Figueira said 3:23PM on 9-12-2008
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... :)
Big John said 10:50AM on 9-08-2008
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?
Reply
Johloemoe said 10:52AM on 9-08-2008
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"
Kev Orng said 11:03AM on 9-08-2008
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.
Reply
ds said 12:10PM on 9-08-2008
Actually, if you Command-click a link, it will open in a new tab (as long as the preferences are set as such).
brian said 2:38PM on 9-08-2008
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.
Manish said 11:27AM on 9-08-2008
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.
Reply
Cycomachead said 9:53AM on 9-09-2008
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.
Eimantas said 2:40PM on 9-08-2008
This one doesn't work on Safari 4 developer preview 1.
Reply
George said 11:57AM on 9-08-2008
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/
Reply
Johloemoe said 12:53PM on 9-08-2008
as i posted before... yes ;)
will said 12:14PM on 9-08-2008
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.
Reply
Johan S. said 2:29PM on 9-08-2008
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.
Reply