Force links to open in new tabs in Safari

Today's Best Tech Deals

Picked by Macworld's Editors

Top Deals On Great Products

Picked by Techconnect's Editors

One of the reasons I like Firefox is that it has a built-in setting (in the Tabs section of its preferences) to force links that want to open new windows to instead open in new tabs. I really hate “window proliferation” while browsing, and this setting makes it such that links which try to force a new window to open—such as the links on our own Mac OS X Hints Pick of the Week page—open in a new tab instead.

Safari doesn’t have any such setting in its preferences—there is an option to make Command-click open links in new tabs, and that works on links that open new windows. However, if you’d rather not hold down the Command key, you can use a hidden preferences setting to force all such links to open in new tabs instead of new windows. To enable this feature, quit Safari and open Terminal (in Applications -> Utilities). Enter the following command, then press Return:

defaults write TargetedClicksCreateTabs -bool true

Launch Safari again, and you’ll find that any links that would normally open new windows will open a new foreground tab instead. Because the tab comes to the foreground, I prefer to use the Command-click solution for my normal browsing, as that forces a new tab to open in the background.

However, I also have this hidden preference set, mainly for use when visiting sites I’ve never visited before. That way, I don’t have to hold Command key down before clicking every link; if a link wants to open a new window, the worst I’ll see is a new tab popping up in the foreground.

If you ever want to disable this hidden setting, quit Safari and open Terminal again, enter the following command, then press Return:

defaults delete TargetedClicksCreateTabs

Relaunch Safari, and links that request new windows will again appear in new windows. Thanks to Mac OS X Hints reader Dennis Stevense for finding this one.

Note: When you purchase something after clicking links in our articles, we may earn a small commission. Read our affiliate link policy for more details.
Shop Tech Products at Amazon