1.ua介绍:
ua查询参考网址:http://www.atool.org/useragent.php(也可以自己制作html查询)
js 属性:navigator.userAgent
使用方法:将网址输入浏览器,显示该浏览器对应的ua信息,以及浏览器的其他信息
2.ua区分表+js判断
客户端
| 区分字符串
|
安卓
| Android
|
苹果
| iPad,iPhone
|
微信
| MicroMessenger(含有MQQBrowser)
|
| QQ + MQQBrowser
|
qq浏览器
| MQQBrowser
|
微博
|
|
1.使用ua判断客户端需要注意ios和android之间可能存在同种客户端,不同ua的情况
2.微信浏览器中带着MQQBrowser的问题,推荐先判断微信关键字,再判断qq
常见ua展示:安卓-小米6
手机qq:Mozilla/5.0 (Linux; Android 8.0; MI 6 Build/OPR1.170623.027; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/044113 Mobile Safari/537.36 V1_AND_SQ_7.6.8_872_YYB_D QQ/7.6.8.3615 NetType/WIFI WebP/0.3.0 Pixel/1080
手机qq浏览器:
Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; MI 6 Build/OPR1.170623.027) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/8.6 Mobile Safari/537.36
手机微信:
Mozilla/5.0 (Linux; Android 8.0; MI 6 Build/OPR1.170623.027; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/044109 Mobile Safari/537.36 MicroMessenger/6.7.1321(0x26070030) NetType/WIFI Language/zh_CN
手机企业微信:
Mozilla/5.0 (Linux; Android 8.0; MI 6 Build/OPR1.170623.027; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/044113 Mobile Safari/537.36 wxwork/2.4.22 MicroMessenger/6.3.22 NetType/WIFI Language/zh
手机小米浏览器:
Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; MI 6 Build/OPR1.170623.027) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/9.8.0
chrome浏览器:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36