Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Force 'new window' links to open in new tabs in Safari Web Browsers
After browsing for a few hours in Safari, it's possible to end up with a dozen windows or so because of links that open a new window (links with target="_blank"). I've always wished there was a way to have these links open in a new tab instead of a new window (sometimes referred to as single window mode).

In the latest Safari 3.1, Apple finally added a (hidden) preference to do just this! To enable single window mode, which forces all links that would normally open a new window appear in a new tab instead, we only need to enable the TargetedClicksCreateTabs preference using the following command (paste it into Terminal):
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
[robg adds: This worked for me, but note that it will create those new tabs in the foreground, not the background. Command-clicking the link, however, will open the page in a new tab in the background (this has always been true, as I recall). The preference setting is mostly useful for sites you haven't visited before -- with it set, you'll not have window proliferation if you just click instead of command-clicking. To undo the setting, you can just delete the preference: defaults delete com.apple.Safari TargetedClicksCreateTabs. Make sure Safari's not running before you use either command.]
    •    
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[40,519 views]  

Force 'new window' links to open in new tabs in Safari | 25 comments | Create New Account
Click here to return to the 'Force 'new window' links to open in new tabs in Safari' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Force 'new window' links to open in new tabs in Safari
Authored by: rmcmahan on Wed, Mar 26 2008 at 8:30AM PDT
This "sort-of" worked for me. After running the command, I could click on a "new window" link but nothing would happen until I command-clicked. Then I got a new tab (in the background). I mistakenly thought that it would revert to normal if I just changed "true" to "false" but it didn't. I reapplied the command with "true" and then applied the command above to delete the preference but that did not change anything either. I still have to command-click on "new window" links. Hm-m-m. Maybe if I re-install safari 3.1...

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: michno on Wed, Mar 26 2008 at 8:33AM PDT
There has to be some other way 'cause on my computer Safari opens links that would otherwise open in a new windows, in a new background tab. I've had it like this "forever" so I have no idea what command I used to get it this way.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: Spartacus on Wed, Mar 26 2008 at 8:42AM PDT
SafariStand?

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: waderz on Wed, Mar 26 2008 at 9:02AM PDT
On any link in Safari, Command Click opens a new tab in the foreground, Command Shift Click opens a new tab in the background. This has been around awhile, surprised no one uses it.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: tatilsever on Thu, Mar 27 2008 at 11:42AM PDT
I click with the middle button of my mouse (the scroll ball on Mighty Mouse) to open links in a new tab in the background.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: Finn on Wed, Mar 26 2008 at 9:03AM PDT
CMD + click or just drag a link from a web page on to the Safari tab bar to open a new tab.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: MacTipper on Wed, Mar 26 2008 at 10:22AM PDT
Several people are saying that this already works for them in Safari. The way you probably got this behavior was by going to the "Tabs" pane of the Safari prefs and unchecking "Cmd-Click opens a link in a new tab".

The difference though, is that the links the tip works on are links that have target="about.blank" in them. So a link like this one forces Safari to open the link in a new window. But when you use this tip, this same link opens in a new tab.


As far as running the defaults delete... command, using true and false worked for me.

MacTipper
My Mac-Tipping Blog

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: porkchop_d_clown on Wed, Mar 26 2008 at 11:13AM PDT
Oh, thank you. That's one of the two behaviors that Firefox has that I miss in Safari.

Now, if I could re-open recently closed tabs....


---
Everyone loves a clown, but no one will lend him money!

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: deebster on Wed, Mar 26 2008 at 12:20PM PDT
Force 'new window' links to open in new tabs in Safari
Authored by: macfreek57 on Wed, Mar 26 2008 at 11:41AM PDT
Good news (for me, at least): it doesn't seem to work on new windows created by javascript (i.e. window.open()), so most advertisements and interface utility windows will still "pop up" rather than opening a new tab.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: ra5ul on Fri, Mar 28 2008 at 12:57PM PDT
actually it does. it only allows resized popups, where "resized" means firefox's "browser.link.open_newwindow.restriction = 2".

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: marook on Wed, Mar 26 2008 at 5:32PM PDT
Ahh, as this is in the GUI, it's not really hidden. It's been a GUI pref since they introduced Tabs.

Prefs: General:
Open links from other applications: in a new Tab in the current window.

That pref has worked for me always, as it seems to apply this to '_blank' links as well.

---
/Marook

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: zpjet on Thu, Mar 27 2008 at 6:21AM PDT
no it doesn't. _blank windows open in a new one.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: mtchandler on Wed, Mar 26 2008 at 8:43PM PDT
try safari stand plug in it really works

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: the_0ne on Wed, Mar 26 2008 at 8:46PM PDT
Just wanted to share a problem I had with my mbp when running this command. I noticed "no" links that would open to a new window/tab worked anymore. I mean nothing, links just stopped working. I couldn't figure out why because my iMac at work took this command fine. And both machines are configured pretty similarly.

I figured out the problem through the apple support forums. Apparently I installed SafariStand back before the upgrade to Safari 3.1. I had to remove the SafariStand.bundle file from HD/Library/Application Support/ Simbl/Plugins. Restart Safari and voila, works now and the new setting for opening new windows in tabs works fine now also.

Now, I also read in the forums that you can just reinstall the latest SafariStand and that'll work fine also. However, the only reason I installed SafariStand to begin with was for this functionality, so I didn't re-install. But like I said, my work machine has SafariStand installed and it works fine with this new command. Maybe it was just an old version of SafariStand.

Good luck...

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: luhmann on Wed, Mar 26 2008 at 11:03PM PDT
In Firefox I have the Google search box set to open search results in a new tab, but I don't know how to make Safari do this. In Safari 3 it seemed I could do this by holding down the "command" key, but since 3.1 I seem to have lost this functionality.

[ Reply to This | # ]
Command-click/Google Preferences
Authored by: drmacnut on Thu, Mar 27 2008 at 6:26PM PDT
I think you'll find that Safari version 3.1 (build 5525.13) works fine for doing what you need, luhmann. Check your Safari prefs once again in the Tabs section.

Also, if for some reason you might want Google to open clicked results URLs in a new window by default, that is a Preference setting that is found with _Google_ itself. Go to www.google.com and click on the Preferences link to the right of the search box and you'll see a check box for "Open search results in a new browser window." Of course, that can always be overridden with a simple Command-click to open the result in a new _tab_ instead, as has been mentioned ad infinitum on this thread.

[ Reply to This | # ]
Let Your Fingers Do The Walking
Authored by: drmacnut on Thu, Mar 27 2008 at 6:16PM PDT
Sorry to say it, folks, but all this futzing around with modifying prefs and using SafariStand or Saft or whatever just makes things worse in my opinion, especially as Safari sees regular code updates from Apple. As others have already mentioned (Robg, Finn, et al.), there is a much simpler solution: Command-click. Safariʻs prefs should be set so that Command-click opens the link in a new tab, and the option to have that tab be selected automatically or not is also available in the pref panel.

Of course, you can always just right-click (Control-click) and select "Open Link in New Tab". Activate the Status bar (View -> Show Status Bar) so you can see what result your actions will have as you mouse over the links.

Look at what Command-click does vs. Shift-Command-click vs. Option-Command-click. Surprise!

The way some of you approach these simple actions seems a bit like trying to use a rubber band connected to a velcro patch glued to your dashboard to turn the key in your carʻs ignition, rather than simply using your hand. Just sayinʻ.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: carfield on Fri, Mar 28 2008 at 11:34PM PDT
If I click links at gmail, it will still popup a new windows....

May be this is not work for webkit?

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: macamanic on Mon, Mar 31 2008 at 10:33AM PDT
Download "Secrets" for free. At the top of the page click on "PrefPane" and it will download into you system preferences. Open it, click "Safari" on the left pane and scroll down to "Single Window Mode". Check the box and restart safari when prompted.

http://secrets.textdriven.com/preferences/list


[ Reply to This | # ]
Middle-click
Authored by: slur on Thu, Apr 17 2008 at 1:14AM PDT
If your mouse has a middle button or click-wheel, you can use it to open a link in a new tab. (This may not work if you've reassigned your middle button.)

---
|
| slur was here
|

[ Reply to This | # ]
Not working
Authored by: spectre51 on Thu, Apr 17 2008 at 9:01PM PDT
I tried this and it still isn't working for me all my new window links still open in a new window. Why can't this be a preference....

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: mgshattuck89 on Tue, Jun 9 2009 at 8:21AM PDT
I realize this is an older thread, but I just wanted to let everyone know this hint still holds true in Safari 4.

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: hasseg on Wed, Sep 23 2009 at 11:33AM PDT
This is not working for me on Snow Leopard (10.6.1) and Safari 4.0.3 but I've heard from someone with the same versions of Mac OS and Safari that it is indeed working for them. Does anyone know what the problem might be?

[ Reply to This | # ]
Force 'new window' links to open in new tabs in Safari
Authored by: draft on Tue, Feb 9 2010 at 10:50AM PST
This solution does not work for me either (OS X v10.6.2 and Safari v4.0.4). Does anyone have a solution to this issue? I really want to get this working…

Thanks,
David

[ Reply to This | # ]