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.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=2008032109273043