Why does the User-Agent always contain Mozilla?

Source: Internet
Author: User

Are you curious about the User-Agent that identifies the browser? Why does each browser contain Mozilla?

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36Mozilla/5.0 (Linux; U; Android 4.1.2; zh-tw; GT-I9300 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)

The story has to start from scratch. The first major character is NCSA Mosaic (MOSAIC ), it was developed by the National Center for supercomputing applications (NCSA) at the University of Illinois at the end of 1992 and released in 1993. It claims"Ncsa_mosaic/2.0 (Windows 3.1)"Mosaic can display text and images at the same time, making the browser much more interesting.

However, another browser appeared soon. This is the famous Mozilla, Chinese name mobla. Mozilla = mosaic + killer, mosaic killer, Mozilla = mosaic & Godzilla, mosaic and Godzilla. Mozilla's original mascot was a big green lizard, later it was changed to the red Tyrannosaurus rex, which looked the same as Godzilla.

But Mosaic was very unhappy with this, so Mozilla later renamed it Netscape, that is, the network landscape. Netscape claims"Mozilla/1.0 (win3.1)", Things started to become more interesting. The Netscape Support Framework (FRAME) has become popular, but Mosaic does not support the framework. Therefore, the website administrator detects the user agent and sends a page containing the framework to the Mozilla Browser, send a page without a framework to a non-Mozilla Browser.

Later, Wangjing was happy with Microsoft and said that Microsoft's Windows was "a hardware driver that has not been debugged ". Microsoft is angry and has serious consequences. After that, Microsoft developed its own browser, Internet Explorer, and hoped it could become Netscape killer. IE also supports the framework, but it is not Mozilla, so it always does not receive pages containing the framework. Microsoft is very depressed and will soon be overwhelmed. It does not want to wait until all website administrators understand IE and send a page containing a framework to IE. it chooses to announce that IE is compatible with Mozilla, it imitates Netscape and calls ie"Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)", So Ie can receive the page containing the framework, and all Microsoft users are confused, but the website administrator is dizzy.

Because Microsoft bound Internet Explorer to Windows and made Internet Explorer better than Netscape, the first bloody battle of browsers broke out. As a result, Netscape withdrew from the stage of history with a failure, and Microsoft became more arrogant. However, I did not expect Netscape to be reborn in the name of Mozilla and developed gecko. This time it is called"Mozilla/5.0 (windows; U; Windows NT 5.0; en-US; RV: 1.1) Gecko/20020826".

Gecko is an outstanding rendering engine. Mozilla later became Firefox and claimed to be"Mozilla/5.0 (windows; U; Windows NT 5.1; SV-se; RV: 1.7.5) Gecko/20041108 Firefox/1.0". Firefox has outstanding performance, and gecko has begun to attack the ground. Other new browsers use its code and call them"Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; RV: 1.7.2) Gecko/20040825 Camino/0.8.1AndMozilla/5.0 (windows; U; Windows NT 5.1; de; RV: 1.8.1.8) Gecko/20071008 SeaMonkey/1.0", Each one pretends to be Mozilla, and all of them use gecko.

Gecko is excellent, and IE cannot keep up with it. Therefore, the user agent detection rules have changed. Gecko browsers are used to send better code, but other browsers do not. Linux followers are very upset about this because they have compiled Konqueror and its engine is khtml. They think that khtml is as good as gecko, but they cannot get a good page because it is not gecko, therefore, Konqueror disguised itself as "like gecko" to get a better page and called it"Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (khtml, like gecko)". Since then, the user agent has become more chaotic.

At this time, opera jumps out and says, "There is no doubt that we should let users decide which browser they want us to pretend to be ." Therefore, opera simply created a menu item for the user to choose to change the Opera Browser to"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) opera 9.51", Or"Mozilla/5.0 (Windows NT 6.0; U; en; RV: 1.8.1) Gecko/20061208 Firefox/2.0.0 opera 9.51", Or"Opera/9.51 (Windows NT 5.1; U; en)".

Later, Apple developed the Safari browser and used khtml as the rendering engine. However, Apple added many new features, so apple called WebKit from another branch of khtml, but it does not want to discard those pages written for khtml, so safari calls it"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) applewebkit/85.7 (khtml, like gecko) Safari/85.5", Which further increases the chaos of the user agent.

Because Microsoft is very popular with Firefox, ie is reinstalled. This time it is called"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)", And the rendering effect is equally good, but the website administrator needs to instruct it to do so.

Later, Google developed the Chrome browser Golden Avenue entertainment city. Chrome used WebKit as the rendering engine. Like safari, it wanted the pages written for Safari, so it pretended to be safari. Chrome uses WebKit and disguise itself as safari. WebKit is disguised as khtml, khtml is disguised as gecko, and finally all browsers are disguised as Mozilla, this is why all browsers have Mozilla In User-Agent. Chrome calls it"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".

Because of the above history, the current user-agent string has become a mess and almost cannot demonstrate its original meaning. To trace the root cause, Microsoft can be said to be the initiator of all this, but later everyone tried to pretend to be someone else, and finally made the User-Agent messy.

In a word, the website developer may output program code with some special functions (special functions here) because you are a browser (Mozilla here ), so when other browsers support this kind of good feature, they try to imitate the Mozilla Browser and let the website output the same content as Mozilla, rather than the code of the program that is castrated. Everyone tries to pretend that they are a browser that does not exist in Mozilla to make the website output the best content ......

See the following table for the birth year of various browsers:

  • January 23, 1993: Mosaic
  • December 1994: Netscape
  • December 1994: Opera
  • August 16, 1995: Internet Explorer
  • October 14, 1996: kongqueror
  • January 7, 2003: Safari
  • December September 2, 2008: chrome

Why does the User-Agent always contain Mozilla?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.