Home > News content

Why does every browser's Mozilla have User-Agent?

via: 博客园     time:2016/9/18 16:59:28     readed:2925

Are you curious to identify the User-Agent of your browser, why do you have Mozilla in every browser?

Mozilla/5.0 (NT Windows 6.1; WOW64) AppleWebKit/537.36 (KHTML, Gecko like) Safari/537.36 Chrome/27.0.1453.94

Mozilla/5.0 (Linux; U; 4.1.2; Zh-tw; GT-I9300; Build/JZO54K Android) AppleWebKit/534.30 (KHTML, Gecko like) Mobile Safari/534.30 Version/4.0

Mozilla/5.0 (NT Windows 6.1; WOW64; rv:20.0) Firefox/20.0 Gecko/20100101

Mozilla/5.0 (compatible; MSIE 9; NT Windows 6; Trident/5.0)

Have Congtoushuiqi story, the original protagonist named NCSA Mosaic, referred to as Mosaic (mosaic) is located at the end of 1992, University of Illinois, Bana - Champaign, National Center for Supercomputing Applications (National Center for Supercomputing Applications, referred to as NCSA) development, and in 1993 released a browser. It calls itself "NCSA_Mosaic/2.0 (Windows 3.1)", Mosaic can also display text and pictures, from the browser has become much more interesting.

But Mosaic is not very happy about it, then later renamed Mozilla Netscape, which is netscape. Netscape calls himself "Mozilla/1.0 (Win3.1)", and things are starting to get more interesting. The framework supports Netscape (frame), because everyone's love framework becomes popular, but Mosaic does not support the framework, so the site administrator to detect user agent, the Mozilla browser sends a frame containing the page, the page of the framework without sending non Mozilla browser.

Then take the fun of Microsoft Netscape, Microsoft said Windows is "the driver does not have the hardware debugging". Microsoft is very angry, the consequences are very serious. Since then, Microsoft developed its own browser, which is Explorer Internet, and I hope it can become a Killer Netscape. IE also supports the framework, but it's not Mozilla, so it's always close to a page that contains a frame. Microsoft is very depressed soon chenbuzhuqi, it does not want to wait until all the webmaster all know about IE and IE to send frames containing the page, it announced that IE is compatible with Mozilla, and the imitation of Netscape called IE "Mozilla/1.22 (compatible; MSIE 2; Windows 95)", so IE can receive an the framework of the page, all Microsoft people hi skin, but the webmaster began to swim.

Because Microsoft will be bundled with IE and Windows sales, and IE do better than Netscape, so the first browser bloody war broke out, the result is Netscape to quit the stage of history, Microsoft more hi skin. But did not expect Netscape actually in the name of the rebirth of Mozilla, and the development of the Gecko, which is called "Mozilla/5.0" (Windows; U; NT Windows 5; en-US; rv:1.1) Gecko/20020826".

Gecko is a rendering engine and is very good. Mozilla later became Firefox, and claimed "Mozilla/5.0 (Windows; U; NT; Windows; sv-SE; rv:1.7.5;;) Firefox/1.0 Gecko/20041108". Firefox performance is very good, Gecko also began a new browser other take cities and seize territory, the use of its code, and they call themselves "Mozilla/5.0 (Macintosh PPC Mac OS X; U; Mach-O; en-US; rv:1.7.2) Gecko/20040825 Camino/0.8.1" and "Mozilla /5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20071008 SeaMonkey/1.0", every one will own pretend Mozilla, and they all use Gecko.

Gecko is very good, and IE can not keep up with it, so agent user detection rules changed, the use of Gecko browser is sent a better code, and other browsers do not have such treatment. The followers of Linux was very sad, because they wrote Konqueror, its engine is KHTML, they think KHTML and Gecko as well, but because Gecko is not without a good page, so Konqueror to get better page disguised himself as "like Gecko", and called "Mozilla/5.0 (compatible FreeBSD (KHTML); Konqueror/3.2; like, Gecko)". Since then agent user has become even more chaotic.

Then more Opera out of the question, there is no doubt that we should allow users to decide what they want us to pretend to be a browser." So Opera simply create menu items to allow users to choose to let the Opera browser into the Mozilla/4.0 (compatible; MSIE 6; Windows NT 5.1; en 9.51) Opera, or "Mozilla/5.0" (Windows NT 6; 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)".

Apple later developed the Safari browser, and use KHTML as the rendering engine, but Apple added many new features, so apple KHTML from another branch called WebKit, but it does not want to abandon those written for the KHTML page, so Safari called "Mozilla/5.0 (Macintosh PPC Mac OS; U; X; de-de AppleWebKit/85.7 (KHTML), like Gecko Safari/85.5)", which further exacerbated the user agent chaos.

Because Microsoft is afraid of Firefox, so IE reloaded, this time it calls "Mozilla/4.0 (compatible; MSIE 8; Windows NT 6)", and rendering as well, but need webmaster instructions to do it so.

Later, Google developed the Chrome browser, Chrome use Webkit as a rendering engine, and Safari before the same, it wants those pages written for Safari, so it disguised as Safari. The use of WebKit and Chrome, and disguised himself as Safari WebKit, KHTML KHTML in disguise, disguised as Gecko, finally all browsers disguised as Mozilla, which is why all browsers are Mozilla User-Agent. Chrome claiming to be "Mozilla/5.0 (Windows; U; NT Windows 5.1; en-US) AppleWebKit/525.13 (KHTML, Gecko like) Safari/525.13 Chrome/".

Because of this history, now the User-Agent string is a mess, almost impossible to highlight its original meaning. Instead, Microsoft can be said to be all but then every one of the initiator of evil, are trying to pretend to be others, finally put User-Agent upside.

Sentence conclusion: because the site developers may because you are a browser (here Mozilla), so the output of some special function code (here refers to the special function of good), so when the other browsers also support this function, and try to imitate the Mozilla browser allows the site to output Mozilla with the same content. Rather than the output of castration function code. Everyone in order to let the site out of the best content, are trying to pretend that they are Mozilla does not exist in a browser......

The browser is born of chronology:

January 23, 1993: Mosaic

December 1994: Netscape

1994: Opera

August 16, 1995: Explorer Internet

October 14, 1996: Kongqueror

January 7, 2003: Safari

September 2, 2008: Chrome

China IT News APP

Download China IT News APP

Please rate this news

The average score will be displayed after you score.

Post comment

Do not see clearly? Click for a new code.

User comments