时间爱人

为什么所有主要浏览器的User-Agent都是Mozilla/5.0开头

你是否好奇标识浏览器身份的User-Agent,为什么每个浏览器都有Mozilla字样?

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

Mozilla/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.30

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)

故事还得从头说起,最初的主角叫NCSA Mosaic,简称Mosaic(马赛克),是1992年末位于伊利诺伊大学厄巴纳-香槟分校的国家超级计算机应用中心(National Center for Supercomputing Applications,简称NCSA)开发,并于1993年发布的一款浏览器。它自称“NCSA_Mosaic/2.0(Windows 3.1)”,Mosaic可以同时展示文字和图片,从此浏览器变得有趣多了。

然而很快就出现了另一个浏览器,这就是著名的Mozilla,中文名称摩斯拉。一说 Mozilla = Mosaic + Killer,意为Mosaic杀手,也有说法是 Mozilla = Mosaic & Godzilla,意为马赛克和哥斯拉,而Mozilla最初的吉祥物是只绿色大蜥蜴,后来更改为红色暴龙,跟哥斯拉长得一样。

但Mosaic对此非常不高兴,于是后来Mozilla更名为Netscape,也就是网景。Netscape自称“Mozilla/1.0(Win3.1)”,事情开始变得更加有趣。网景支持框架(frame),由于大家的喜欢框架变得流行起来,但是Mosaic不支持框架,于是网站管理员探测user agent,对Mozilla浏览器发送含有框架的页面,对非Mozilla浏览器发送没有框架的页面。

后来网景拿微软寻开心,称微软的Windows是“没有调试过的硬件驱动程序”。微软很生气,后果很严重。此后微软开发了自己的浏览器,这就是Internet Explorer,并希望它可以成为Netscape Killer。IE同样支持框架,但它不是Mozilla,所以它总是收不到含有框架的页面。微软很郁闷很快就沉不住气了,它不想等到所有的网站管理员都了解IE并且给IE发送含有框架的页面,它选择宣布IE是兼容Mozilla,并且模仿Netscape称IE为“Mozilla/1.22(compatible; MSIE 2.0; Windows 95)”,于是IE可以收到含有框架的页面了,所有微软的人都嗨皮了,但是网站管理员开始晕了。

因为微软将IE和Windows捆绑销售,并且把IE做得比Netscape更好,于是第一次浏览器血腥大战爆发了,结果是Netscape以失败退出历史舞台,微软更加嗨皮。但没想到Netscape居然以Mozilla的名义重生了,并且开发了Gecko,这次它自称为“Mozilla/5.0(Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826”。

Gecko是一款渲染引擎并且很出色。Mozilla后来变成了Firefox,并自称“Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0”。Firefox性能很出色,Gecko也开始攻城略地,其他新的浏览器使用了它的代码,并且将它们自己称为“Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040825 Camino/0.8.1”,以及“Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.8) Gecko/20071008 SeaMonkey/1.0”,每一个都将自己装作Mozilla,而它们全都使用Gecko。

Gecko很出色,而IE完全跟不上它,因此user agent探测规则变了,使用Gecko的浏览器被发送了更好的代码,而其他浏览器则没有这种待遇。Linux的追随者对此很难过,因为他们编写了Konqueror,它的引擎是KHTML,他们认为KHTML和Gecko一样出色,但却因为不是Gecko而得不到好的页面,于是Konqueror为得到更好的页面开始将自己伪装成“like Gecko”,并自称为“Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko)”。自此user agent变得更加混乱。

这时更有Opera跳出来说“毫无疑问,我们应该让用户来决定他们想让我们伪装成哪个浏览器。”于是Opera干脆创建了菜单项让用户自主选择让Opera浏览器变成“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)”。

后来苹果开发了Safari浏览器,并使用KHTML作为渲染引擎,但苹果加入了许多新的特性,于是苹果从KHTML另辟分支称之为WebKit,但它又不想抛弃那些为KHTML编写的页面,于是Safari自称为“Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5”,这进一步加剧了user agent的混乱局面。

因为微软十分忌惮Firefox,于是IE重装上阵,这次它自称为“Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ”,并且渲染效果同样出色,但是需要网站管理员的指令它这么做才行。

再后来,谷歌开发了Chrome浏览器,Chrome使用Webkit作为渲染引擎,和Safari之前一样,它想要那些为Safari编写的页面,于是它伪装成了Safari。于是Chrome使用WebKit,并将自己伪装成Safari,WebKit伪装成KHTML,KHTML伪装成Gecko,最后所有的浏览器都伪装成了Mozilla,这就是为什么所有的浏览器User-Agent里都有Mozilla。Chrome自称为“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”。

因为以上这段历史,现在的User-Agent字符串变得一团糟,几乎根本无法彰显它最初的意义。追根溯源,微软可以说是这一切的始作俑者,但后来每一个人都在试图假扮别人,最终把User-Agent搞得混乱不堪。

一句话结论:因为网站开发者可能会因为你是某浏览器(这里是 Mozilla),所以输出一些特殊功能的程序代码(这里指好的特殊功能),所以当其它浏览器也支持这种好功能时,就试图去模仿 Mozilla 浏览器让网站输出跟 Mozilla 一样的内容,而不是输出被阉割功能的程序代码。大家都为了让网站输出最好的内容,都试图假装自己是 Mozilla 一个已经不存在的浏览器……

  附:各大浏览器诞生年表:

根据考证,世界上第一个浏览器是WorldWideWeb,诞生于1990年。 而第一个普及的,是由NCSA开发的Mosaic浏览器。

1993年1月23日:Mosaic Alpha,同年3月推出0.1版本,它实际上也是Netscape与IE的共同祖先。

1994年12月:Netscape 1.0(Mozilla/1.0)

1994年:Opera,基于Elektra排版引擎(已成为历史)。

1995年8月16日:Internet Explorer 1.0(Mozilla/1.22)

1996年10月14日:Kongqueror浏览器,基于KHTML引擎,主要应用于 Linux 和 BSD家族的操作系统。

1998年,Windows98横空出世,捆绑了IE4.0,Netscape最终被彻底地打败!

1998年11月24日,美国在线AOL宣布收购Netscape公司。之后将所有Netscape的浏览器原始代码都送给了开源社群自行开发,并成立开源社区Mozilla(mozilla.org)。

2000年11月:网景公司正式发布Netscape 6.0,基于新一代的排版引擎Gecko。

2001年10月,微软发布Windows XP,因为忌惮Firefox的性能优势,XP系统捆绑发布了Internet Explorer 6.0(Mozilla/4.0)。

2003年1月7日:Safari beta,基于KHTML排版引擎。

2003年6月,Opera7.0,启用Presto排版引擎。

2003年7月15日,美国在线AOL解散了网景公司Netscape,而Mozilla基金会亦在当天成立,它就是现在Firefox浏览器的管理和推进组织,从此FireFox成了削弱IE市场份额的一只重要棋子,Netscape的借尸还魂术宣告成功。

2003年,苹果推出了采用WebKit引擎的浏览器 Safari。

2004年11月9日:Mozilla基金会发布了Firefox的第一个正式版本1.0(Mozilla/5.0),基于Gecko排版引擎。

2005年,苹果宣布将WebKit完全开源(之前仅有从KHTML直接搬来的WebCore及JavaScriptCore是开源的)。

2008年9月2日:Chrome,基于Chromium引擎,WebKit的一个分支。。

2010年4月,苹果公司宣布了其浏览器引擎Webkit的最新项目Webkit2。

2013年2月,Opera宣布将用WebKit替代当前的核心浏览器引擎Presto。

2013年4月3日,谷歌宣布将与苹果的开源浏览器核心Webkit分道扬镳,在Chromium项目中研发Blink渲染引擎,内置于Chrome浏览器之中。

2013年4月,Opera又宣布放弃WEBKIT,跟随GOOGLE的新开发的Blink引擎。

2015年6月7日,Windows10预览版,启用Microsoft Edge浏览器名称,WebCore是EdegHTML,JSCore是Chakra。

2016年1月12日起,微软停止为IE8/9/10这些旧版本的IE浏览器提供技术支持,Internet Explorer正式退出。

4,423 thoughts on “为什么所有主要浏览器的User-Agent都是Mozilla/5.0开头

  1. Wow, awesome weblog layout! How lengthy have you been blogging
    for? you make running a blog look easy. The total glance
    of your website is fantastic, as smartly as
    the content material!

  2. It is perfect time to make some plans for the longer term
    and it is time to be happy. I have learn this put up and if I may
    just I wish to counsel you few interesting things or advice.
    Maybe you could write next articles relating to this article.
    I desire to read even more things approximately it!

  3. Hello! Someone in my Facebook group shared this site with
    us so I came to take a look. I’m definitely
    loving the information. I’m bookmarking and will be tweeting this to my followers!
    Terrific blog and wonderful style and design.

  4. After exploring a number of the blog articles on your blog,
    I really like your way of writing a blog. I book-marked it to my bookmark site list and will be checking back soon. Please check out my
    website as well and let me know what you think.

  5. I just couldn’t depart your website before suggesting that I really enjoyed the usual info an individual supply for
    your visitors? Is going to be back often in order to investigate cross-check new posts

  6. We stumbled over here coming from a different page and thought
    I may as well check things out. I like what I see so i
    am just following you. Look forward to finding out about your web page yet again.

  7. Greate article. Keep writing such kind of info on your site.
    Im really impressed by it.
    Hello there, You have done a fantastic job. I will definitely digg it and in my view recommend
    to my friends. I’m confident they’ll be benefited from this website.

  8. Unquestionably consider that that you said. Your favorite reason appeared to be on the net the easiest factor
    to be mindful of. I say to you, I certainly get
    annoyed even as folks consider worries that they plainly don’t know about.
    You managed to hit the nail upon the top and also defined out the whole thing without having
    side-effects , other people could take a signal.
    Will probably be again to get more. Thanks

  9. With havin so much written content do you ever run into any issues of plagorism or copyright violation? My website has
    a lot of completely unique content I’ve either created myself or outsourced but it looks like a
    lot of it is popping it up all over the internet without
    my permission. Do you know any solutions to help stop content from being ripped off?

    I’d truly appreciate it.

  10. Just want to say your article is as astonishing. The clearness to your submit is just great and i
    can think you’re an expert on this subject. Well together with your
    permission allow me to seize your RSS feed to keep up to date with drawing close post.
    Thanks one million and please keep up the enjoyable work.

  11. An impressive share! I have just forwarded this onto a colleague who
    was conducting a little research on this. And he in fact bought
    me breakfast because I found it for him… lol.
    So let me reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending time to discuss this issue here
    on your internet site.

  12. Hello there! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my blog to rank for some targeted keywords
    but I’m not seeing very good gains. If you know of any please share.
    Thanks!

  13. Good day I am so grateful I found your website, I really found you by mistake, while I was looking on Aol for something else,
    Anyways I am here now and would just like to say kudos for a marvelous post and a all round entertaining blog
    (I also love the theme/design), I don’t have time to read through
    it all at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back to read a
    lot more, Please do keep up the great work.

  14. Hi there! This post couldn’t be written any better! Reading this post
    reminds me of my old room mate! He always kept talking about this.
    I will forward this post to him. Fairly certain he will have a
    good read. Thank you for sharing!

  15. Hello there! I know this is kind of off topic but I was wondering if you knew where I could get a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having
    difficulty finding one? Thanks a lot!

  16. Woah! I’m really loving the template/theme of this website.

    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and appearance.
    I must say you’ve done a great job with this. In addition, the
    blog loads very quick for me on Safari. Excellent Blog!

  17. Hey There. I found your blog using msn. This is an extremely well written article.
    I will make sure to bookmark it and return to read more of your useful information. Thanks for the post.

    I’ll definitely comeback.

  18. What i do not realize is in truth how you’re not really much more smartly-favored than you might be right now.
    You are very intelligent. You already know therefore significantly
    in relation to this topic, made me in my opinion believe it from so
    many numerous angles. Its like women and men are not fascinated unless it is one thing to accomplish
    with Woman gaga! Your own stuffs outstanding. Always take care of
    it up!

  19. Excellent website you have here but I was curious about
    if you knew of any user discussion forums that cover the same topics talked about in this article?
    I’d really love to be a part of group where I can get responses from other knowledgeable
    people that share the same interest. If you have any suggestions,
    please let me know. Cheers!

  20. I am really inspired with your writing abilities and also with
    the layout for your weblog. Is that this a paid subject matter or did
    you modify it your self? Anyway keep up the nice high quality
    writing, it’s rare to look a great weblog like this one today..

  21. Appreciating the commitment you put into your website
    and in depth information you present. It’s great to come across a blog every once in a while that isn’t the same outdated rehashed information. Excellent read!
    I’ve saved your site and I’m including your RSS feeds to my Google account.

  22. Index Search Villas and lofts to rent, search by region, find in a few minutes a villa to book by city, a variety of rooms
    lofts and villas. Be stunned at the photographs and
    information that the site has to present you. The site is a
    center for every person the ads in the field, bachelorette party?
    Play with a friend who leaves Israel? It doesn’t matter
    what the rationale you should rent a villa for a forthcoming event or simply a
    group recreation ideal for any age. The website is also the biggest
    market of rooms because of the hour, which
    is definitely another subject, for lovers who are looking for an opulent room equipped for discreet entertainment using a spouse or lover.
    Regardless of what you are interested in, the 0LOFT website produces a hunt for you to identify
    rentals for loft villas and rooms throughout Israel, North South and Gush Dan.

  23. Hey there this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if
    you have to manually code with HTML. I’m starting a
    blog soon but have no coding experience so I wanted to get guidance
    from someone with experience. Any help would be greatly appreciated!

  24. Do you have a spam issue on this site; I also am a blogger, and I
    was curious about your situation; many of us have created some nice practices and we
    are looking to exchange methods with other folks, please
    shoot me an email if interested.

  25. BJ방송 |bj방송다시보기 |bj부들이다시보기 |사이트좀알려줘 |스트리밍사이트ㅊㅊ |스트리밍사이트정리2019 |스트리밍사이트정리2018 |사이트공유한다 |사이트공유좀 |미니언-bj |미니언tv |홍구미니언 |악어사건 |악어얼굴 |악어해신 |악어노가리 |악어해신13회차 |재밌는BJ |재밌는토크 |재밌는애니 |재밌는게임 |재밌는BJ방송 |재밌는토크방송 |재밌는애니방송 |재밌는게임방송 |무서운BJ |무서운토크 |무서운애니 |무서운게임 |무서운BJ방송 |무서운토크방송 |무서운애니방송 |무서운게임방송 |야한BJ |야한토크 |야한애니 |야한게임 |야한BJ방송 |야한토크방송 |야한애니방송 |야한게임방송 |예쁜BJ |예쁜토크 |예쁜애니 |예쁜게임 |예쁜BJ방송 |예쁜토크방송 |예쁜애니방송 |예쁜게임방송 |인기BJ |인기토크 |인기애니 |인기게임 |인기BJ방송 |인기토크방송 |인기애니방송 |인기게임방송 |먹방BJ |먹방토크 |먹방애니 |먹방게임 |먹방BJ방송 |먹방토크방송 |먹방애니방송 |먹방게임방송 |최신BJ |최신토크 |최신애니 |최신게임 |최신BJ방송 |최신토크방송 |최신애니방송 |최신게임방송 |재밌는BJ스트리밍 |재밌는토크스트리밍 |재밌는애니스트리밍 |재밌는게임스트리밍 |무서운BJ스트리밍 |무서운토크스트리밍 |무서운애니스트리밍 |무서운게임스트리밍 |야한BJ스트리밍 |야한토크스트리밍 |야한애니스트리밍 |야한게임스트리밍 |예쁜BJ스트리밍 |예쁜토크스트리밍 |예쁜애니스트리밍 |예쁜게임스트리밍 |인기BJ스트리밍 |인기토크스트리밍 |인기애니스트리밍 |인기게임스트리밍 |먹방BJ스트리밍 |먹방토크스트리밍 |먹방애니스트리밍 |먹방게임스트리밍 |최신BJ스트리밍 |최신토크스트리밍 |최신애니스트리밍 |최신게임스트리밍 |음악BJ |게임BJ |스포츠BJ |토크BJ |성인BJ |음악토크 |게임토크 |스포츠토크 |토크토크 |성인토크 |음악BJ스트리밍 |게임BJ스트리밍 |스포츠BJ스트리밍 |토크BJ스트리밍 |성인BJ스트리밍 |음악토크방송 |게임토크방송 |스포츠토크방송 |토크토크방송 |성인토크방송

  26. Hi there! This article could not be written any better!
    Going through this article reminds me of my previous roommate!
    He always kept preaching about this. I’ll send this information to him.

    Pretty sure he’ll have a great read. Thanks for sharing!

  27. Great post. I was checking constantly this blog and I am impressed!
    Extremely helpful information specially the last part 🙂 I care for such info much.
    I was seeking this certain info for a long time.
    Thank you and best of luck.

  28. Definitely believe that which you said. Your favorite justification appeared
    to be on the web the simplest thing to be aware of. I say to you, I definitely get irked while people consider worries that they just don’t know about.
    You managed to hit the nail upon the top and defined
    out the whole thing without having side-effects , people could take a signal.
    Will likely be back to get more. Thanks

发表评论

电子邮件地址不会被公开。 必填项已用*标注

答案 : *
20 − 17 =


返回顶部