Strange User Agent With Google Chrome

Shiv Deepak picture Shiv Deepak · Oct 26, 2010 · Viewed 13.8k times · Source

I was working with some javascript and found a strange user agent with my Google Chrome.

I have Google Chrome 7.0.517.41 beta installed on my Ubuntu Laptop. Now AFAIK my user agent should be something close to Chrome/7.0.517.41

but it is showing me:

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7

Why is this happening.. I have disabled all the installed extensions but it is still the same..

Answer

Piskvor left the building picture Piskvor left the building · Oct 26, 2010

The UA string tells the long and tragic history of (in)compatibility attempts. See e.g. this for a brief history of the UA. It should also make clear that UA sniffing is useless, as every modern browser pretends to be many other browsers. That is also the case you see here:

  • Mozilla - the most ancient artefact, dating from the early 1990s
  • X11 - the graphical interface used
  • Linux i686 - OS and processor type
  • en_US - your locale (English, United States)
  • AppleWebKit/534.7 - the actual rendering engine
  • (KHTML, like Gecko) - another artifact of browser sniffing: "Gecko" is the FF rendering engine, KHTML is an old rendering engine, predecessor of WebKit (was used by Konqueror browser, than forked by Apple to form WebKit)
  • Chrome/7.0.517.41 - the actual browser version
  • Safari/537 - yet another artifact against scripts sniffing for "Safari" (which uses the same engine)

In short: some broken sites assumed that "only allowing people with Mozilla/Firefox/Webkit/whatever" is a sensible policy; in turn, browsers started lying about their origins to get around these artificial barriers. The UA strings are the result: bloatware, full of useless garbage.