Top

How to force Safari 4 to open links in a new Tab instead of a new Window

February 26, 2009 by Ross McKillop 

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.

Random Posts

To receive articles like this one delivered directly to your inbox, enter your email address in the field below. You can always opt out of these updates at any time.

Share/Save/Bookmark

Comments

35 Responses to “How to force Safari 4 to open links in a new Tab instead of a new Window”

  1. Matt Bracksieck on February 26th, 2009 3:14 pm

    I get

    “Unexpected argument true; leaving defaults unchanged.”

  2. Rick on February 26th, 2009 6:49 pm

    And how to do this with the Windows version?

  3. links for 2009-02-26 (Jarrett House North) on February 26th, 2009 7:01 pm

    [...] How to force Safari 4 to open links in a new Tab instead of a new Window : Switching To Mac Hidden defaults setting that forces links that would open in a new window to open in a new tab instead. Should be default behavior. (tags: safari macosx) [...]

  4. Dee on February 26th, 2009 7:25 pm

    Thanks! Works great

  5. Ben Northway on February 26th, 2009 7:36 pm

    That’s awesome! Thanks!

  6. David on February 26th, 2009 9:28 pm

    Command-Click will do the same thing.

  7. Ross McKillop on February 26th, 2009 9:32 pm

    David -

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

  8. Ereon on February 27th, 2009 3:23 am

    Thanks for your tips :) Realy great

  9. Crazor on February 27th, 2009 7:06 am

    Works for Safari 3, too

  10. Carl on February 27th, 2009 8:44 pm

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

  11. Windows Weekly 96: The Quickening – castmedium on February 27th, 2009 8:55 pm

    [...] the tab management has made things worse for many.  Thankfully there is a tweek if you want to return the tabs to there original location through the terminal. Windows 7 RC1, Google and EU vs. Microsoft, Kindle 2, Safari, and [...]

  12. Mike on February 28th, 2009 9:56 am

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

  13. Ross McKillop on February 28th, 2009 1:55 pm

    @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 :)

  14. How to force Safari 4 to open new windows in Tabs on March 2nd, 2009 11:13 am

    [...] is a quick way to make sure all new links open in a new tab (tutorial via): Start by opening a Terminal window (Applications -> Utilities -> Terminal). Enter the following [...]

  15. Paul on March 4th, 2009 8:19 pm

    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.

  16. Mike on March 5th, 2009 10:56 pm

    “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?

  17. david on March 8th, 2009 7:47 am

    i just wanted to post how awesome you are!

  18. Anonymous on March 9th, 2009 10:06 pm

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

  19. tormac on June 9th, 2009 1:01 am

    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.

  20. Phil on June 10th, 2009 10:28 pm

    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.

  21. Walt Ribeiro on June 12th, 2009 10:56 am

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

  22. Johan Platteau on June 14th, 2009 4:59 am

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

  23. Brad Bulkley on June 21st, 2009 1:01 pm

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

  24. Bill on June 22nd, 2009 9:19 am

    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*

  25. matt on June 25th, 2009 10:09 am

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

  26. MilleFleurs on June 25th, 2009 11:50 am

    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?

  27. Ben on July 2nd, 2009 8:30 am

    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!

  28. Como forzar links en Safari 4 a abrir en Tabs en vez de New Windows | Mac User Boricua on July 8th, 2009 7:12 am

    [...] Vía - Switching to Mac [...]

  29. Thib on September 2nd, 2009 12:09 pm

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

  30. carreralee on September 5th, 2009 10:11 am

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

  31. Eric Herlitz on September 17th, 2009 8:14 am

    Nope, wont work in snow leopard

  32. Ross McKillop on September 17th, 2009 8:34 am

    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.

  33. Tim Brown on September 23rd, 2009 2:19 pm

    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.

  34. H Smith on October 5th, 2009 11:13 am

    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?

  35. Carly on October 13th, 2009 7:40 pm

    Thanks! Perfect solution.

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





Bottom