browserbrowser-detectionbrowser-feature-detection

Why do user agents / browsers lie


I have read several articles on feature detection and that it is more reliable than browser detection because browsers lie.

I couldn't find any information on why they lie. Does anyone know the reason why they would do that?


Solution

  • As far as I understand it, Webmasters do browser sniffing to find the capabilities of a browser and limit what they send to the browser. If a browser lies about it's capabilities they will receive more from the webmaster, you can read more:

    http://farukat.es/journal/2011/02/499-lest-we-forget-or-how-i-learned-whats-so-bad-about-browser-sniffing

    http://webaim.org/blog/user-agent-string-history/