Translation: The Evolutionary History of UserAgent

by vermin1 on 2008-12-27 22:22:49

News Source: Ye Yan

Google's launch of Chrome has sparked much discussion, but only tech-savvy users would notice the "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" UserAgent string that appears when browsing with Chrome. It looks like a cryptic code, so what exactly does it mean? Let's take a look.

Back in the day, there was a browser called NCSA Mosaic, which identified itself as NCSA_Mosaic/2.0 (Windows 3.1). It supported text display along with images, making the Web more fun. Then came a new web browser, "Mozilla," which essentially meant "Mosaic killer." This irked Mosaic (after all, Mosaic had been around longer and was well-established), and the new browser eventually became officially known as Netscape, identifying itself as Mozilla/1.0 (Win3.1). It got even more interesting as Netscape supported frames, which then became popular among users. However, Mosaic did not support frames, leading to the birth of the great "user agent detection" technology — if the user agent was "Mozilla," then a frame-supported page would be sent; for other browsers, a non-frame version would be delivered.

Netscape wanted to tease Microsoft by calling Windows "a device driver that has almost never been debugged," which infuriated Microsoft. In response, Microsoft launched its own web browser, Internet Explorer, hoping it would become the "Netscape killer." Internet Explorer also supported frames, but it wasn't Mozilla, so no one sent it frame-enabled pages. As Microsoft grew increasingly frustrated, they stopped relying on website administrators gradually recognizing IE and instead claimed compatibility with Mozilla. They began mimicking Netscape, identifying themselves as Mozilla/1.22 (compatible; MSIE 2.0; Windows 95). Thus, Internet Explorer could receive framed pages, sparking joy across Microsoft, but confusing website administrators. Microsoft bundled IE with Windows and improved their product to outperform Netscape, initiating the first browser war. The result, as everyone knows, was Netscape's downfall and Microsoft's triumphant victory.

Later, Netscape was reborn under the name Mozilla, constructing Gecko, identifying itself as Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826. Gecko is a rendering engine that performed excellently. Mozilla developed Firefox, identifying itself as Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0, and Firefox performed exceptionally well too. Gecko expanded rapidly, with some browsers using its code and identifying themselves as Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040825 Camino/0.8.1, or Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.8) Gecko/20071008 SeaMonkey/1.0. Both disguised themselves as Mozilla and were based on Gecko support.

Gecko performed outstandingly, while IE lagged far behind. Thus, another identity check occurred, where well-designed web codes were sent to Gecko, while other browsers didn't receive the same treatment. Linux enthusiasts were disheartened because they created Konqueror, based on the KHTML engine, which didn't receive good codes. Although they believed KHTML was as excellent as Gecko, Konqueror began disguising itself as "like Gecko" to get better web pages, identifying itself as Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko). The world became even more confusing.

Then Opera came into play, claiming "allowing users to decide which browser to pretend to be." Its menu provided options such as Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.51, Mozilla/5.0 (Windows NT 6.0; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.51, Opera/9.51 (Windows NT 5.1; U; en), letting users choose who to impersonate.

Apple developed Safari, using KHTML and adding many new features. Later, they combined everything into WebKit. However, they still hoped to receive web pages written for KHTML, so Safari identified itself as Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5, further complicating the situation.

Microsoft, increasingly concerned about Firefox's growth, restarted the development of Internet Explorer, identifying itself as Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0). It could render code well, but only if website administrators instructed it to do so.

Google also developed its own browser, Chrome, using Webkit, similar to Safari, hoping to receive web pages written for Safari. So, Chrome decided to disguise itself as Safari. Here's the thing: Chrome uses the WebKit rendering engine, pretending to be Safari, while WebKit pretends to be KHTML, which in turn pretends to be Gecko. Meanwhile, all browsers claim to be Mozilla. Therefore, Chrome identifies itself as 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. The UserAgent string has become thoroughly chaotic and hardly serves any purpose anymore. Everyone claims to be someone else, spreading confusion everywhere.