Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do you change User Agent in Safari?

In Firefox there is a plugin that can be downloaded and disguises the Browser as IE for IE only websites. Does Safari have the same capabilities and how is it done.

powerbook g4, Mac OS X (10.5.2)

Posted on Feb 21, 2008 4:00 PM

Reply
Question marked as Best reply

Posted on Feb 21, 2008 4:10 PM

Hi

Welcome to Apple Discussions

You'll need to activate the Debug menu first.
First, quit Safari.
Open Terminal.app in your Utilities folder.
When the Terminal window opens, copy & paste the following command into the window:

defaults write com.apple.Safari IncludeDebugMenu 1

Press "return", you may be prompted for an admin password. If so, enter it.
If necessary, press "return" again.
When you see your Mac's name, the Terminal entry is done.
Quit Terminal
Restart Safari and go to the Debug Menu. There, you'll find the User Agent selections.
16 replies
Question marked as Best reply

Feb 21, 2008 4:10 PM in response to jumptolive

Hi

Welcome to Apple Discussions

You'll need to activate the Debug menu first.
First, quit Safari.
Open Terminal.app in your Utilities folder.
When the Terminal window opens, copy & paste the following command into the window:

defaults write com.apple.Safari IncludeDebugMenu 1

Press "return", you may be prompted for an admin password. If so, enter it.
If necessary, press "return" again.
When you see your Mac's name, the Terminal entry is done.
Quit Terminal
Restart Safari and go to the Debug Menu. There, you'll find the User Agent selections.

Feb 21, 2008 4:40 PM in response to Hawaiian_Starman

Actually, I think I just got it to work. It is a secure admin site for my website. When you login it opens a new window and the original window redirects to the public side of my website. When I stop the redirection it goes right through and does not crash. So you have helped me greatly and I appreciate it. Now for the next question, how do you view a webpage that is whitten in .aspx instead or .html?

Mar 23, 2008 5:36 PM in response to jumptolive

Similar issue here. I've been unable to get Safari 3.1 to display the (previous) Debug menu, which many posts state is the only way to PERMANENTLY change the default User Agent setting from "Automatically Chosen" to whichever one in the list is preferred. Safari Enhancer, as the developer advises, won't work with Leopard. Onyx and Xspinner show Debug being enabled, but it doesn't show up on Safari relaunch. Even going into the Package Contents of Safari and removing all User Agents but the desired one (in the UserAgents.plist) doesn't have any effect; "Automatically Chosen" remains the default setting, and wherever the profile resides that the browser is automatically choosing and sending, it essentially undoes the user selection of an alternative user agent each time the app is launched. Back to square one, and this gets old fast. Does anyone have a way to turn off "Automatically Chosen" as the default user agent setting and establish one of the profiles in the list as the new default profile? Thanks.

Mar 23, 2008 5:49 PM in response to jumptolive

You don't have to do anything special to view an .aspx page, it just works. If it isn't working for you, then you have other problems. For instance, here's a site that uses a .NET back-end that works fine in Safari:

http://www.seiu925.org/Early_Learning/Default.aspx

Does the above work for you?

Btw, changing Safari's userAgent might get you past some scripts, but you may then recieve browser-specific code that is incompatible with Safari, causing other issues. Your mileage may vary, etc.

Mar 23, 2008 6:45 PM in response to Hawaiian_Starman

Starman,

Your advice regarding the Debug menu no longer applies to Safari 3.1. There is no Debug menu in Safari 3.1. Instead there is a Develop menu that can be activated through Safari 3.1's preferences. Navigating to Preferences->Advanced reveals a "Show Develop menu in menu bar" check box. Activate this menu and you can change user agents from a drop down menu. No longer any need to enter a terminal command! Neat!

Mar 23, 2008 7:02 PM in response to golabuk

Does anyone have a way to turn off "Automatically Chosen" as the default user agent setting and establish one of the profiles in the list as the new default profile? Thanks."


No, there is no way to make the user agent change permanent. Why would Apple even allow something like that? The older Debug menu and Safari 3.1's new Develop menu were added for one purpose only, to assist in problem solving and cross platform development. If you want to permanently change user agents why not just change browsers or operating systems altogether? This defeats the whole purpose of using profiles so that web sites can taylor pages to the particular quirks of certain browsers and for security reasons. And as someone else has pointed out changing the user agent doesn't change anything about the operation of Safari. All it does is identify to the web site that the specified browser is present when in reality it is not. You're just fooling the web site, not changing any behavior. Personally I have not encountered ANY web sites in the past two years at least that refused to respond to the Safari browser.

May 14, 2008 6:55 PM in response to lkrupp

Why would Apple allow something like this? Why not? Several of the available User Agent profiles take care of sensitive servers (e.g., online banking) without creating problems with other sites. The aim here, not hard to grasp, is to find the one that works optimally in cases where the default "Automatically Chosen" doesn't. Glad you hear you haven't run into ANY (sic) web sites in the past two years that refused to respond to Safari, but obviously this isn't the point. You've clearly misunderstood; the aim wasn't to "change anything about the operation of Safari," and my question made no mention of a problem "fooling the [problematic] web site." It was looking for a workaround to having to do that manually each time. Obviously users can change the User Agent to "get" finicky servers to recognize Safari for, say, an online banking transactions, but when the user conducts transactions with such a site often, it's a pain to have to manually "tell" Safari each time to imitate a server-acceptable browser. That was the reason for the question. If you don't have a solution or something constructive to contribute, hold onto your reply and your rhetorical questions to keep these forums friendly. Your not having run into a problem doesn't mean it isn't a problem for someone else.

May 16, 2008 6:48 PM in response to ra5ul

Thanks much for the link, ra5ul. Haven't tried this, but at least it responds to the question. Since my earlier post, I learned that there's a utility called MacPilot that allows (among many other things) for a permanent change to the Safari default User Agent that Safari (rather than its native "Automatically Chosen"). No doubt the MacPilot GUI is just providing a pretty way to execute the terminal command in the link provided by ra5ul above. From that link, here's the suggested command (use at your own risk):

defaults write com.apple.Safari CustomUserAgent "\"user agent string\""

where "user agent string" (sans the quotes) is replaced by the actual user agent string for the User Agent of choice.

Best wishes to all.

How do you change User Agent in Safari?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.