views:

359

answers:

2

I see many web development tools that let me change this thing called the "user-agent". What it it?

+6  A: 

The user agent doesn't change how Safari renders a page, it just changes what browser Safari pretends to be when making the HTTP request, and when calling navigator.userAgent in JavaScript. Some web servers and some JavaScript on web pages will change their behavior based on the user agent (which is generally a bad idea), and so sometimes if a web server gives you a page back saying "Sorry, your browser isn't supported", you may want to change your user agent to IE to see if it actually works even though they don't support it.

Brian Campbell
Also, I like your name; juggling for the win!
Brian Campbell
+1  A: 

The user agent switching is not a "mode" all it does is makes Safari report the IE/Firefox/etc user agent -- so navigator.userAgent will report the UA of a different browser.

This is only really useful when you're looking at supporting safari (or webkit in general) and want to rule out user agent checks as the cause of "incompatibilities"

olliej