浏览器User-agent的解析

浏览器User-agent的解析过程如下:

为什么要有Mozilla,请看上一篇文章,只有,Opera才光明正大,写着自己的名字,

user-agent一般包括三个内容:

                             系统版本,

                            浏览器内核,

                            浏览器版本,

总结如下:

             IE用的trident内核;

             Firefox用的Gecko内核;

             Safari用的自己的WebKit内核,(防Gecko)

             Chrome也用的Webkit内核,(防safari,即防Gecko)


IE 

  而IE各个版本典型的userAgent如下: 
   Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) 
  Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2) 
  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 
  Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)
 
  其中,版本号是MSIE之后的数字。 

Firefox  
  Firefox几个版本的userAgent大致如下: 
   Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/2008070208 Firefox/3.0.1 
  Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070309 Firefox/2.0.0.3 
  Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070803 Firefox/1.5.0.12
  其中,版本号是Firefox之后的数字。 

Opera  
  Opera典型的userAgent如下: 
   Opera/9.27 (Windows NT 5.2; U; zh-cn) 
  Opera/8.0 (Macintosh; PPC Mac OS X; U; en) 
  Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en) Opera 8.0
  
  其中,版本号是靠近Opera的数字。 

Safari  
  Safari典型的userAgent如下: 
   Mozilla/5.0 (Windows; U; Windows NT 5.2) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13 
  Mozilla/5.0 (iPhone; U; CPU like Mac OS X) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3 

  其版本号是Version之后的数字。 

Chrome  
  目前,Chrome的userAgent是: 

Mozilla/5.0 (Windows; U; Windows NT 5.2) AppleW

ebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13  

  其中,版本号在Chrome之后的数字。 


附加一个Windows NT版本:、

Windows NT 各发布版本
NT 版本 市场名称 版本 发布日期 RTM
Build
NT 3.1Windows NT 3.1Workstation(仅被命名为“Windows NT”), Advanced Server1993年7月27日528
NT 3.5Windows NT 3.5Workstation, Advanced Server1994年9月5日807
NT 3.51Windows NT 3.51Workstation, Server1995年5月30日1057
NT 4.0Windows NT 4.0Workstation, Server, Server Enterprise Edition,
Terminal Server, Embedded
1996年7月29日1381
NT 5.0Windows 2000Professional, Server, Advanced Server, DataCenter Server2000年2月17日2195
NT 5.1Windows XPHome, Professional, Media Center, Tablet PC, Starter, Embedded, N2001年10月15日2600
NT 5.2Windows XP64-bit Edition Version 2003 (此专为IA64而开发), Professional x64 Edition
  • IA64: 2003年3月28日
  • x64: 2005年4月25日
3790
Windows Server 2003Standard, Enterprise, DataCenter, Web, Small Business Server2003年4月24日
Windows Server 2003 R2Standard, Enterprise, DataCenter, Web, Small Business Server2005年12月6日
NT 6.0Windows VistaStarter, Home Basic, Home Premium, Professional, Enterprise, Ultimate2007年1月30日
  • 6000 (RTM)
  • 6001 (SP1)
  • 6002 (SP2)
Windows Server 2008Foundation, Standard, Enterprise, Datacenter, Web Server, HPC Server, Itanium-Based Systems2008年8月27日
  • 6001 (RTM)
  • 6002 (SP2)
NT 6.1Windows 7Starter, Home Basic, Home Premium, Professional, Enterprise, Ultimate2009年10月22日
  • 7600 (RTM)
  • 7601 (SP1)
Windows Server 2008 R2Foundation, Standard, Enterprise, Datacenter, Web Server, HPC Server, Itanium-Based Systems2009年10月22日
  • 7600 (RTM)
  • 7601 (SP1)
NT 6.2Windows 8Windows 8, Windows 8 Pro, Windows 8 Enterprise, Windows RT2012年10月26日9200
Windows Phone 8 不适用2012年10月30日9900
Windows Server 2012Foundation, Essentials, Standard, Datacenter2012年9月4日9200
NT 6.3Windows 8.1Windows 8.1, Windows 8.1 Pro, Windows 8.1 Enterprise, Windows RT 8.12013年10月18日9600
Windows Server 2012 R2Essentials, Standard, Datacenter2013年10月18日9600


再介绍一个小技巧:
探测64位版本IE
携带4GB内存的机器越来越多,运行64位版本Windows的用户也越来越多,为了解决第三方插件的兼容性问题,32位版本的IE仍然是64位Windows里的默认版本。在某些情况下,它对网站识别用户使用64位系统的访问具有很大的作用,比如,某个网站可能需要自动识别是否需要为用户提供64位程序下载。
UA字符串里的标记可以让你知道用户是否使用Windows 64位系统,以及他们是否运行着64位IE:
WOW64代表“Windows on Windows 64-bit.”

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值