views:

379

answers:

3

To make cross platform and cross browser website application what is the role of user agent switcher?

https://addons.mozilla.org/en-US/firefox/addon/59

alt text

Is user agent different thing then rendering engine?

and if some browser use same rendering engine then do we need to check on every browser or one is enough?

+3  A: 

User agent is the string the browser sends along in the HTTP headers to identify itself. This is how various sites distinguish between IE, FireFox/Mozilla, Safari/Webkit, and the like.

A user agent informs the site of the rendering engine involved, but is not itself the rendering engine.

Wikipedia

Kevin Montrose
+6  A: 
  • A rendering engine is the engine that a browser uses to render the html (i.e. gecko vs webkit).
  • A user agent is how a browser identifies itself (i.e firefox 3.5).

But even if you switch the user agent of lets say firefox to safari, it will still use the gecko rendering engine to render it's page.

So to check how a page renders in different browsers you really need to render the page in those different browsers.

Thomas Maas
and if some browser use same rendering engine then do we need to check on every browser or one is enough?
metal-gear-solid
yes we still need to check if they use different versions of the the rendering engine: like safari doesn't use the same webkit version as chrome.
Thomas Maas
A: 

Some websites render content differently according to the User Agent that is being sent. For example, if the User Agent is IE 6, the language used to render the webpage (e.g. PHP) could be used to add a class "ie6" to an element, and then CSS is used to control what gets displayed or not. Or, a separate js file can be added depending on the user agent.

Some years ago, Opera recommended that you set the User Agent as IE 6, because websites will consistently not render if the User Agent was not any of IE or Mozilla. But, I think this is no longer the case.

nimbupani