April 26, 2012

Relics of the browser wars : All browsers are Mozilla

A web developers life is like this:

  • The beginning : I'll do the coolest site on the Internet, I feel so lucky.
  • Also in the beginning : What? Is not working in Internet Explorer? OK, let's fork the code for it.
  • After a couple of days : WTF?! Am I seeing things? Is not working in IE6, IE7, IE8, IE9 but the problem is different?! Stack Overflow.. Stack Overflow..
  • The end : Find some work on the server-side or move on.

People freak out when they suppose to do web development and we wonder why. After a couple of days of work on the best site ever everyone realizes that the site is not working well in all the browsers (i.e. IE.) We need to know what browser we are dealing with so we can do something (e.g serve a minimal version of the site.)

How this madness started?

And behold, then came a new web browser known as “Mozilla”, being short for “Mosaic Killer,” but Mosaic was not amused, so the public name was changed to Netscape, and Netscape called itself Mozilla/1.0 (Win3.1), and there was more rejoicing. And Netscape supported frames, and frames became popular among the people, but Mosaic did not support frames, and so came “user agent sniffing” and to “Mozilla” webmasters sent frames, but to other browsers they sent not frames.
In that moment, when none of today's browsers even existed, the "user agent sniffing" was born. Whow, is so old.

Internet Explorer

And Internet Explorer supported frames, and yet was not Mozilla, and so was not given frames. And Microsoft grew impatient, and did not wish to wait for webmasters to learn of IE and begin to send it frames, and so Internet Explorer declared that it was “Mozilla compatible” and began to impersonate Netscape, and called itself Mozilla/1.22 (compatible; MSIE 2.0; Windows 95), and Internet Explorer received frames, and all of Microsoft was happy, but webmasters were confused.
IE wanted to be Mozilla. Funny that it didn't matched many other features of Mozilla or next generation's Gecko/Firefox.

KHTML

And the followers of Linux were much sorrowed, because they had built Konqueror, whose engine was KHTML, which they thought was as good as Gecko, but it was not Gecko, and so was not given the good pages, and so Konquerer began to pretend to be “like Gecko” to get the good pages, and called itself Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko) and there was much confusion.
KHTML wanted to be Gecko, so was some kind of Mozilla.

Webkit

And Apple built Safari, and used KHTML, but added many features, and forked the project, and called it WebKit, but wanted pages written for KHTML, and so Safari called itself Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5, and it got worse.
Safari wanted to be KHTML, so was some kind of Gecko which means was so kind of Mozilla

Chrome

And then Google built Chrome, and Chrome used Webkit, and it was like Safari, and wanted pages built for Safari, and so pretended to be Safari. And thus Chrome used WebKit, and pretended to be Safari, and WebKit pretended to be KHTML, and KHTML pretended to be Gecko, and all browsers pretended to be Mozilla, and Chrome called itself Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13, and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded.
You know the drill..
Here is the full article, History of the browser user-agent string

Post Mortem

Today the madness continues but is not useful anymore.
A fine web developer knows this days that he should not sniff for the browser but instead check if features are available.

No comments:

Post a Comment