How to Force Safari 4 to Open Links in a New Tab instead of a New Window

By default, any time a web site uses the target=”_blank” attribute on a link (like this one), Safari 4 will open that link in a new window. If you’d prefer it to open in a new Tab, follow the instructions outlined in this brief tutorial.

Start by opening a Terminal window (Applications -> Utilities -> Terminal). Enter the following command:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

semi-transparent Terminal in OS X

Now restart Safari. Links that used to open in a new Window (like this one) will now open in a new Tab instead.

safari 4 tabs reverted to use the style in safari 3

If you decide you want to change back, just re-enter the command but replace true at the end of the command with false.

More posts from the Safari Category

picture-2

How to Resume a Previous Browsing Session in Safari

Open_Glims_Installer.png

Add New Search Engines To Safari with Glims

Change-Font.png

Changing Safari’s Default Fonts

keychain-access.png

How to Make Safari Remember Passwords

  1. Matt Bracksieck says:

    I get

    "Unexpected argument true; leaving defaults unchanged."

  2. Rick says:

    And how to do this with the Windows version?

  3. Dee says:

    Thanks! Works great

  4. Ben Northway says:

    That's awesome! Thanks!

  5. David says:

    Command-Click will do the same thing.

  6. Ross McKillop says:

    David –

    Absolutely true. As does right-click > Open Link in New Tab

  7. Ereon says:

    Thanks for your tips :) Realy great

  8. Crazor says:

    Works for Safari 3, too

  9. Carl says:

    Middle Mouse Button will do the same thing – you can choose how you want to open links. Yup, I said choose!

  10. Mike says:

    Don't you get the same result by simply doing this: Command-click? No need to mess with terminal.

  11. Ross McKillop says:

    @Mike –

    Absolutely yes. But some people (myself included) would rather just click than have to hold down the command key at the same time. You can also "middle click" (depending on your mouse) to open a link in a new tab, but again, I (and a bunch of folks it seems) prefer just to 'normal' left click. Different strokes for different folks :)

  12. Paul says:

    As small a thing as it may be, this has played an appreciable role in keeping me with firefox instead of safari. I don't know why apple doesn't make this the default behavior for opening links (or even provide the option in the preferences). Thanks a million for clearing my last irritation with safari.

  13. Mike says:

    "No need to mess with terminal." ?

    It takes literally 5 seconds to do.

    Yes, there's clearly ways around this (Control Click, etc). But for someone like me that NEVER opens a new window, why work around when 5 seconds of work fixes it?

  14. david says:

    i just wanted to post how awesome you are!

  15. Anonymous says:

    Another great solution. Many thanks again. I can't imagine why apple made the change in the first place.

  16. tormac says:

    schweet, thanks so much. as a new mac user, this is one of the only things that really, really bugged me. i even downloaded firefox and was really close to ditching safari.

  17. Phil says:

    Thanks, this is really great. Is there another command that can force this tab to open in the background? The option is set in Safari preferences, but it doesn't seem to apply to this new fix.

  18. Walt Ribeiro says:

    Awesome. Was exactly what I was looking for! Thanks :)

  19. Johan Platteau says:

    Thanks, I recently switched from firefox to Safari on Mac and I missed that feature.

  20. Brad Bulkley says:

    Do you know of any way to force those tabs to open in the background?

  21. Bill says:

    Tiny features (or lack thereof) like this drive me absolutely insane. Safari has progressed to a quite fast and slick browser with a graphical page history (a feature I love), but even though this option obviously exists in a config file, they simply couldn't be bothered to expose it via the Preferences interface…..gee, maybe right under the "Open links from Applications in Tabs" settings.

    So let's see:

    1) Click a checkbox or radio button under preferences, or

    2) Type in "defaults write com.apple.Safari TargetedClicksCreateTabs -bool true"

    Yeah, Macs are definitely easier *rolls eyes*

  22. matt says:

    Thanks! Worked perfectly – and in less than 5 seconds!

  23. MilleFleurs says:

    Thanks!

    I did it just now but my Mac opens link with the same Tab not a new Tab.

    How do I fix it?

    Can you help me some how?

  24. Ben says:

    Thanks so much; I've been wanting this for a while, so this hint is great. I've always preferred to keep as many tabs in one window as possible, and for simplicity's sake I've wondered why Apple hasn't agreed with that approach!

    Thanks again!

  25. Thib says:

    Awesome, works great. been looking for this for a while now

    Thanks

  26. carreralee says:

    Yay! Finally, no more Command-clicking. Works perfectly even for a Macbook newbie like me. Thanks!

  27. Eric Herlitz says:

    Nope, wont work in snow leopard

  28. Ross McKillop says:

    Eric –

    I just confirmed that it does in fact work w/ Safari in Snow Leopard. I set the command to end in false, restarted Safari, and links opened in a new window. I re-ran the command w/ true at the end, restarted Safari again, and they opened in tabs. Remember, you have to restart Safari for the command/change to be enabled.

  29. Tim Brown says:

    You rock! That way so annoying. I am very grateful to you for this tip. You have made my life a little better today and for that I thank you.

  30. H Smith says:

    Thanks, much appreciated. One question: do you know how to make Safari open Google search results (from queries in the default search box) in a new tab instead of in the current tab?

  31. Carly says:

    Thanks! Perfect solution.

  32. RAN says:

    solid advice!!! thanks a lot for solving an annoying oversight!

  33. Kelly says:

    Finally!

    So frustrating having a bunch of window open!

    Thank you!

  34. Ben says:

    Bingo! Works like a charm in Safari 4/OS X 10.6.2.

  35. Ben says:

    @H Smith: Command+T before doing your Google search.

  36. Jie Geng says:

    Thanks so much! Very very helpful, easy solution to my problem. I am perplexed as to why Apple doesn't give the option of default to new tab instead of new window. It is SO ANNOYING to have windows pop out all the time, to the point where sometimes I would have several windows that I don't even know existed.

    I agree with the rest of you that HELL YES I would rather just click than to option + click. I would like to remind some of you guys that not all of us are using a mouse. I was forced to switch to Safari after FF keeps crashing my computer (do to RAM), a switch I did not want to make. This was one of those reasons that hindered me from switching in the past.

  37. Keir says:

    Yeah! Awesome solution. Thank you.

  38. James says:

    thanks for that; anyone know how to improve this so that it works for "Open Behind Mail" links in Mail? Although I've set a keyboard shortcut to merge all Safari windows into one, having a new window open each time I open links from emails is a bit unnecessary.

    Cheers and Happy New Year

  39. Kendra Martin says:

    Thank you! This was the key feature needed to make Safari as enjoyable as Firefox.

  40. kms says:

    There are still situations in which Safari opens in the SAME tab, so this is only a partial solution. For example, when I highlight text, "right"-click and then "search with Google." I don't understand this behavior–it's pointless.

    And please, don't point out the command-click workaround. That's a workaround, not a solution. (I guess it's back to Firefox for me. Shame, I wanted to like Safari, but I just can't.)

  41. Oneiros says:

    OMG THANK YOUUUUUUUUUUU

  42. Pene says:

    this has been annoying me for ages – I was so sick of apple-clicking on links I thought might open in a new window just in case and then missing most of the ones that do anyway :)

  43. Matt Bush says:

    How can I do the same on windows?

  44. Rick says:

    Works perfectly on my olde worlde g4 ibook. Thank you Sir. I don't know why this isn't an option under preferences… go figure.

  45. David says:

    This solution does not work for me in OS X v10.6.2 and Safari v4.0.4. Is anyone else experiencing this problem? I really want this to work…

    Thanks,

    David

  46. Chris Cummings says:

    Do you have a way to make these tabs open in the background? that would perfect this with a combination of making google searches open in a new window ( which after this fix open in a new tab!!!)

  47. krut says:

    worked…awesome

    thx man!!

  48. sam dinesh says:

    this may sound strange.. first of all.. i dont know how to open a terminal.. can anyone help me..

  49. cody says:

    thanx soo much

  50. Laura says:

    Awesome! Thanks so much!

  51. dc denison says:

    thanks. good tip.

  52. JR says:

    It was quicker for me to download Firefox than keep trying to make such a basic function work. Ridiculous that either I'm missing something simple or that Safari is. Thank you Mozilla. I shouldn't have to open my terminal and reprogram anything on a brand new computer, especially for such a simple and popular function. Who on earth wants to have a new window open every time you click a link?

  53. KPR says:

    works fine, but gmail chat not rendering, hopefully google's issue but stopped right after config'g. will reverse and see.

  54. Anon says:

    It works; thanks so much.

  55. Tommy says:

    I tried to do this but it didn't seem to work. Help?

  56. yarqgc says:

    Amazing. No more holding down the Apple key! Thanks!!!!

  57. yarqgc says:

    Works for me in Snow Leopard

  58. Dirk says:

    I love you, man.

    This has been irritating me for months.

    Thanks for the tip.

  59. LesM on twitter says:

    My first apple MacBook and the fix works like a hot damn. I am wondering why there are so many diehards when simple options like this are not included in prefs?

  60. chekuri says:

    Its not working!!!!! I am getting access denied message in cmd what should I do??

  61. katy says:

    Thank you. That was driving me nuts.

  62. Halvard says:

    In Safari 5 you can change this in the menu! :)

  63. sm25265 says:

    hi

    thx for offering a solution, but somehow it does not work for me. i am running the latest mac OS. when i enter command in terminal it seems to accept it, no error msg, nothing.

    but loads of the links do not open in tabs but in the same window (which i cannot stand)

    would you have any suggestions to what could have gone wrong?

    thx

  64. Bob says:

    My computer is opening new tabs and I don't want it to. I tried going onto the terminal screen but my prompt is different and not sure how to write it without fear of screwing with my computer. Not confident. Please help stop these annoying tabs and please direct me to having new windows pop-up. Anyone…anyone. :-)

  65. Brittany says:

    This isn't working for me for some reason and it's about to drive me nuts. I'm about to switch browsers, but I really like the read me later thing in this Safari.

  66. Alisha Paul says:

    Worked great! Thanks.

  67. humphrey says:

    Does not work with safari 5.1.7.

  68. Sam says:

    All of you having problems with this, try going to; Terminal>Shell>New Command, copy paste the command in the bar and click Run. Restart Safari. Works fine for me now. Good luck.

Leave a Reply