I’m doing a lot of web development at the moment (re-writing my site in Node.js), and I am being constantly reminded of what a big kludge the whole web is. I was just debugging something, and I looked at the user agent for my browser. The user agent is the string of text the browser sends to the server with every request to identify itself technologically.
Chrome’s looks like this:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
From this we can learn that AppleWebKit is KHTML (it isn’t), which is like Gecko (sorta…), and that Chrome is Mozilla (no!) and Safari (no!), and uses AppleWebKit (it doesn’t!).
In the case of Chrome, the only good information conveyed is:
Mac OS X 10.9.0, Chrome 31.0.1650.63
So why to the makers of Chrome - who are no doubt clever and upstanding people - send out such a horrid, lying bit of text with every request? Well…
Because silly web programmers decided to look at that text to see whether their site would work. Instead of programming things in such a way that they would say “I don’t recognise that browser, let’s try anyway”, they refused to serve pages to unknown browsers. So, Chrome has to say that it is ‘Mozilla’, ‘Safari’, and uses ‘AppleWebKit’, which is ‘KHTML’ and like ‘Gecko’, because some websites refuse to serve content it can handle perfectly well.
So goddamn dumb.