User-Agent Switcher for Safari 4

The User Agent Switcher plug-in for Firefox has been a GREAT add-on and we all love it. 1 year and 27 weeks ago Ronan wrote a really simple, but useful configuration file for it that is available here on mobiForge (if you use Firefox it's a MUST: User Agent Switcher config file).
Since Safari 3 it is possible to switch the User-Agent string the browser sends to the server. Initially it was to emulate other browsers, then they wisely added the iPhone and the iPod Touch so that designers could test their new iPhone-specific sites. Unfortunately it was not possible to personalise that list.
With the release of Safari 4 and thanks to a nice hint on Mac OS X Hints, I've built my own list of mobile devices. See how it looks like now (forgive the Italian at the bottom):

Of course the file is also available for download as an attachment to this article. Install instructions are quite easy:
- Close Safari
- Go to your Applications folder
- Right-click or CTRL-click and select Show Package Contents
- Enter in Contents and then Resources
- Back your UserAgents.plist to a safe place
- Copy the UserAgents.txt that you downloaded into UserAgents.plist
- Start Safari
The file is just text, so if you want to add or change the list of devices it should be easy enough, it took me longer to select the User-Agents than editing. ;)
| Attachment | Size |
|---|---|
| UserAgents.txt | 13.04 KB |



Posted by toddvirgil 21 weeks ago
Is it possible to do this on the PC version of Safari?
Posted by ruadhan 21 weeks ago
Yes - with a little bit of coaxing...
To enable user-agent switching, you need first to activate the Developer/Debug menu. On Windows, you need to open up the Defaults.plist file (usually located at
C:\Program Files\Safari\Safari.resources\Defaults.plist) and add a new key.Add the key & value:
to the file before the closing
</dict>tag.Now restart Safari and you should have a nice new menu at your disposal!
Ruadhan O'DonoghuedotMobi
Posted by savas_2000 17 weeks ago
I followed the instructions, but how can I switch from UA with Safari (using Mac OS X)?