结论:

 浏览器 \ OS XP(IE6) XP(IE7) XP(IE8) Win7 x64(IE9)
猎豹浏览器2.0急速模式     Chrome/21
猎豹浏览器2.0兼容模式 IE6     IE9
淘宝浏览器2.0急速模式     Chrome/20
淘宝浏览器2.0兼容模式 IE6     IE7
QQ浏览器7.0 IE6     IE9
360安全浏览器5.0 IE6     IE7
360安全浏览器5.0自带IE8内核版 IE7 / IE8     IE7 
360急速浏览器6.0急速模式     Chrome/21
360急速浏览器6.0兼容模式 IE6     IE9 / IE7 
搜狗浏览器4.0高速模式     Chrome/17
搜狗浏览器4.0兼容模式 IE7     IE7 
Firefox        
Waterfox        
Chrome 23     Chrome/23

看这张图……360让人大吃一斤……

php与js获得的user agent不一样……淘宝浏览器也有这毛病

测试代码:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Welcome to nginx!</title>
  6. </head>
  7. <body>
  8. <h2>php $_SERVER['HTTP_USER_AGENT']</h2>
  9. <p>
  10. <?php
  11. echo $_SERVER['HTTP_USER_AGENT'];
  12. ?>
  13. </p>
  14. <h2>js navigator.userAgent</h2>
  15. <p>
  16. <script>
  17. document.write(navigator.userAgent);
  18. </script>
  19. <p>
  20. <!--[if lte IE 6]>
  21. <p>lte ie6</p>
  22. <![endif]-->
  23. <!--[if lte IE 7]>
  24. <p>lte ie7</p>
  25. <![endif]-->
  26. <!--[if lte IE 8]>
  27. <p>lte ie8</p>
  28. <![endif]-->
  29. <!--[if lte IE 9]>
  30. <p>lte ie9</p>
  31. <![endif]-->
  32. </body>
  33. </html>

如何识别各个浏览器?

大部分浏览器 在 user agent 中都可以识别。

猎豹浏览器user agent 中有LBBROWSER,但没有版本号。用php无法获得,用js可以获得:

  1. <script>
  2. alert(window.external.LiebaoGetVersion());
  3. </script>

360浏览器无法识别。以前可以用这个识别,但现在不行了:

  1. if (window.external && window.external.twGetRunPath) {
  2. var r = external.twGetRunPath();
  3. if (r && (r.toLowerCase().indexOf("360se") > -1 )) {
  4. ret = true;
  5. }
  6. }

参考360官方资料:http://app.browser.360.cn/ie6bye/

http://se.360.cn/common/qihoo_ie6_tips.js

如何提醒用户升级浏览器:

推荐升级到IE8或360:http://app.browser.360.cn/ie6bye/

推荐升级到IE9:http://godarkforie.org/

效果:

淘宝浏览器2.0 on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11

猎豹浏览器2.0.10.3198 急速模式on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER

猎豹浏览器2.0.10.3198 兼容模式on Windows 7 x64:

  1. Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)

猎豹浏览器2.0.10.3198 兼容模式on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)"

猎豹浏览器1.5.9.2888 急速模式on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 LBBROWSER

猎豹浏览器1.5.9.2888 兼容模式 on Windows 7 x64:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

QQ浏览器7.0 on Windows 7 x64 IE9:

  1. Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)

QQ浏览器7.0 on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)

360安全浏览器5.0自带IE8内核版 on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)

360安全浏览器5.0 on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)

360安全浏览器5.0 on Windows 7 x64 IE9:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

360急速浏览器6.0 急速模式 on Windows XP x86:

  1. Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

360急速浏览器6.0 急速模式 on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

360急速浏览器6.0 兼容模式 on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)

360急速浏览器6.0 兼容模式 on Windows 7 x64 IE9:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

360急速浏览器6.0 IE9/IE10模式 on Windows 7 x64 IE9:

  1. Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

搜狗浏览器4.0 高速模式 on Windows XP x86:

  1. Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 SE 2.X MetaSr 1.0

搜狗浏览器4.0 兼容模式 on Windows XP x86 IE6:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; SE 2.X MetaSr 1.0)

Waterfox 16.0 on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:16.0) Gecko/20121026 Firefox/16.0

iPad:

  1. Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5

Firefox x64 4.0b13pre on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b13pre) Gecko/20110307 Firefox/4.0b13pre

Firefox x64 on Ubuntu 12.04.1 x64:

  1. Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

Firefox x86 3.6.15 on Windows 7 x64:

  1. Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15

Chrome x64 on Ubuntu 12.04.1 x64:

  1. Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11

Chrome x86 23.0.1271.64 on Windows 7 x64:

  1. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11

Chrome x86 10.0.648.133 on Windows 7 x64:

  1. Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16

IE9 x64 9.0.8112.16421 on Windows 7 x64:

  1. Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)

IE9 x86 9.0.8112.16421 on Windows 7 x64:

  1. Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

Firefox x64 3.6.10 on Ubuntu 10.10 x64:

  1. Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10

Andorid 2.2自带浏览器,不支持HTML5视频

  1. Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

浏览器HTTP_USER_AGENT汇总——Firefox、Chrome、IE9、IE8、IE7、IE6的更多相关文章

  1. 区分IE9/IE8/IE7/IE6及其他浏览器-CSS hack

    记录一下这些浏览器的hack如下: 一.IE9以及以下版本浏览器 对于IE8及其以下版本的浏览器,就是使用本文标题所提到的”\9″ hack.如下代码: .ie8_9{ color:blue; /*所 ...

  2. 使用火狐浏览器模仿手机浏览器,附浏览器HTTP_USER_AGENT汇总

    HTTP_USER_AGENT用来获取浏览页面的访问者在用什么操作系统(包括版本号)浏览器(包括版本号)和用户个人偏好. 改变浏览器的这个参数就可以伪装成相应的浏览器. User Agent Swit ...

  3. Firefox、Chrome、IE9、IE8、IE7、IE6等浏览器HTTP_USER_AGENT汇总

    Firefox.Chrome.IE9.IE8.IE7.IE6 浏览器HTTP_USER_AGENT汇总 结论:  浏览器 \ OS XP(IE6) XP(IE7) XP(IE8) Win7 x64(I ...

  4. 区分IE8/IE7/IE6及其他浏览器-CSS “\9″

    区分IE8/IE7/IE6及其他浏览器-CSS “\9″ 原创文章,转载请注明来自张鑫旭-鑫空间-鑫生活[http://www.zhangxinxu.com] by zhangxinxu from h ...

  5. 区分IE8/IE7/IE6及其他浏览器

    在 CSS中常用特殊字符识别表: (1)*:  IE6+IE7都能识别*,而标准浏览器FF+IE8是不能识别*的; (2)!important: 除IE6不能识别 !important外,  FF+I ...

  6. jquery 1.9 1.8 判断 浏览器(IE11,IE8,IE7,IE6)版本

    1.9以后很我方法删除了,所有和之前版本判断浏览器版本有所差记录一下 1.9 ------------------------------------------------------------- ...

  7. IETester for IE11, IE10, IE9, IE8, IE7 IE 6 and IE5.5 on Windows 8 desktop, Windows 7, Vista and XP

    简介: IETester是一个免费的(用于个人和专业用途)WebBrowser,允许您在Windows 8桌面,Windows 7,Vista和XP上拥有IE11,IE10,IE9,IE8,IE7 I ...

  8. firefox chrome ie9,10,11 不支持selectSingleNode和selectNodes的解决方法

    firefox并不支持selectSingleNode和selectNodes的解决方法 function test(){ var perid = document.thisForm.PerID.va ...

  9. 如何让ie8/ie7/ie6支持html5的<footer></footer><nav></nav>等标签

    使用他们能让代码语义化更直观,而且更方便SEO优化.但是此HTML5新标签在IE6/IE7/IE8上并不能识别,需要进行JavaScript处理.以下就介绍几种方式. 方式一:Coding JavaS ...

随机推荐

  1. EXT.net 窗体传值

    ext.net 窗体传值 EXT.net 窗体传值 子窗体代码 protected void btnClose_Click(object sender,EventArges e) { PageCont ...

  2. printf 的格式

    1) 类型类型字符用以表示输出数据的类型,其格式符和意义如下表所示: %c  输出单个字符 %s  输出字符串 %u  以十进制形式输出无符号整数 %d  以十进制形式输出带符号整数(正数不输出符号) ...

  3. java定时任务实现的几种方式(Timer、Spring Task、Quartz)

    Timer JDK自带的Timer类,允许调度一个TimerTask任务. Demo: /** * Timer测试类 */ public class TimerDemo { public static ...

  4. PHP Curl请求Https接口

    在请求http的时候只需要 file_get_contents("http://www.sojson.com/open/api/weather/json.shtml?city=$Positi ...

  5. ROS naviagtion analysis: move_base

    博客转载自:https://blog.csdn.net/u013158492/article/details/50483123 这是navigation的第一篇文章,主要通过分析ROS代码级实现,了解 ...

  6. MySQL——explain性能分析的使用

    用法:explain sql语句: id:查询的序号. ref:进行连接查询时,表得连接关系.可以通过上图看出. select_type:select查询的类型,主要是区别普通查询和联合查询.子查询之 ...

  7. Yii2视频

    Yii2 视频分享 需要的小伙伴看过来链接: https://pan.baidu.com/s/1sl4H0RV 密码: nknx  (有问题请留言)

  8. oracle数据库之分组查询

    本章内容和大家分享的是数据当中的分组查询.分组查询复杂一点的是建立在多张表的查询的基础之上,(我们在上一节课的学习中已经给大家分享了多表查询的使用技巧,大家可以自行访问:多表查询1  多表查询2)而在 ...

  9. MySQL事务隔离级别测试实例

    https://www.cnblogs.com/huanongying/p/7021555.html MySQL事务隔离级别 事务隔离级别 脏读 不可重复读 幻读 读未提交(read-uncommit ...

  10. ios PNG Crush error (PNG图片错误)

    我是这么解决的: I had the same problem. How to fix : Open up image with Preview -> File > Export > ...