News source: Ye Yan
Google's launch of Chrome has sparked heated discussions, but only tech-savvy users have noticed 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 web pages with Chrome. It looks like a cryptic text, so what exactly does it mean? Let's take a look.
Back in the early days, 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 annoyed Mosaic (after all, Mosaic had been around longer and was well-established), and the new browser eventually officially launched under the name Netscape, identifying itself as Mozilla/1.0 (Win3.1). It became even more interesting. Netscape supported frames, which later became popular among users, but Mosaic did not support frames. Thus, the great "user agent detection" technology was born. If the user agent was "Mozilla," then a frame-supported page would be sent; for other browsers, non-frame pages were sent.
Netscape wanted to tease Microsoft by calling Windows "a device driver that almost never needs debugging," which made Microsoft very upset. In response, Microsoft introduced its own web browser called Internet Explorer, hoping it would become the "Netscape Killer." Internet Explorer also supported frames, but since it wasn't Mozilla, no one sent it frame-enabled pages. Microsoft grew increasingly frustrated and stopped relying on webmasters gradually recognizing IE and sending it frames. Instead, it declared itself "Mozilla-compatible" and began imitating Netscape, identifying itself as Mozilla/1.22 (compatible; MSIE 2.0; Windows 95). As a result, Internet Explorer could now receive frames, and Microsoft was overjoyed. However, this confused webmasters somewhat. Microsoft bundled IE with Windows and improved its product to surpass Netscape, sparking the first browser war. The outcome, as everyone knows, was that Netscape was defeated, and Microsoft emerged victorious.
However, Netscape later reincarnated under the new name Mozilla, constructing Gecko and identifying itself as Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826. Gecko is a rendering engine with excellent performance. 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 also performed exceptionally well. Gecko expanded rapidly, and some browsers used its code and identified 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, one example, and Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.8) Gecko/20071008 SeaMonkey/1.0, another example. They all pretended to be Mozilla and were based on Gecko support.
Gecko performed excellently, while IE was poor, leading to further identity recognition. Well-designed web pages were sent to Gecko, but other browsers didn't get the same treatment. Linux followers were saddened because they created Konqueror based on the KHTML engine, which wouldn't receive good code despite their belief that KHTML was as excellent as Gecko. Thus, Konqueror began pretending to be "like Gecko" to get better web pages and identified itself as Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko), making the world even more confusing.
Later, Opera emerged, claiming "allowing users to decide who the browser pretends 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, and Opera/9.51 (Windows NT 5.1; U; en), allowing users to choose who the browser pretends to be.
Apple developed Safari, using KHTML and adding many new features. Eventually, Apple decided to start fresh and called it WebKit, but it still hoped to receive web pages designed for KHTML. Therefore, Safari identified itself as Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5, making the world even more chaotic.
Microsoft became increasingly concerned about Firefox's development and restarted the development of Internet Explorer, identifying itself as Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0), capable of rendering code well, but only if the webmaster instructed it to do so.
Google also developed its own browser, Chrome, using Webkit, similar to Safari, hoping to receive web pages designed for Safari. So, Chrome uses the WebKit rendering engine, pretending to be Safari, while WebKit pretends to be KHTML, and KHTML 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 no longer serves any real purpose, as everyone claims to be someone else, creating chaos everywhere.