Permanently change Safari's User Agent string

Jul 06, '09 07:30:02AM

Contributed by: tvalleau

Most know about enabling the Develop menu in Safari, and how to pick a different user agent using its User Agent entry. However, Safari will revert to automatic mode between launches; it will not remember your setting. Here's how to improve it's memory and remember your setting between launches.

In order to make the User Agent setting stick between launches of Safari, one has to edit a plist file (just entering the User Agent string in the Custom option of the User Agent menu won't stick). To make the changes, quit Safari and open your user's com.apple.safari.plist file, which you'll find in your user's Library/Preferences folder in an editor capable of opening binary plist files. (Otherwise, you'll have to convert it between binary and ASCII first.)

In the plist file, find CustomUserAgent, and edit the value string. To determine the value string to use for your desired user agent, hover above the desired entry in the Develop » User Agent menu. Enter that value, save the file and relaunch Safari, and you should be good to go. Note that this was only tested on 10.5.7 with Safari 4.0.1.

A non-editing alternative is to use MacPilot, which will do the same thing for you.

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090630112653430