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.

Comments [69]

  1. I get

    "Unexpected argument true; leaving defaults unchanged."

  2. David –

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

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

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

  5. @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 🙂

  6. 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.

  7. "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?

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

  9. 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.

  10. 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.

  11. Awesome. Was exactly what I was looking for! Thanks 🙂

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

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

  14. 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*

  15. 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?

  16. 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!

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

    Thanks

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

  19. 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.

  20. 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.

  21. 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?

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

  23. Finally!

    So frustrating having a bunch of window open!

    Thank you!

  24. 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.

  25. 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

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

  27. 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.)

  28. 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 🙂

  29. 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.

  30. 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

  31. 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!!!)

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

  33. 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?

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

  35. I love you, man.

    This has been irritating me for months.

    Thanks for the tip.

  36. 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?

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

  38. 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

  39. 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. 🙂

  40. 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.

  41. 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

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