https://developers.google.com/chrome/mobile/docs/user-agent
16lz
2021-12-04
Google Chrome for Android
Google Chrome
Google Chrome for Android
▾
Documentation
Overview
Remote Debugging
User Agent
FAQ
Chrome for Android User-Agent
Chrome for Android reports its user agent string (UA) in the following formats, depending on whether the device is a phone or a tablet:
Phone UA:
Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>)
AppleWebKit/<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Mobile
Safari/<WebKit Rev>
Tablet UA:
Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>)
AppleWebKit/<WebKit Rev>(KHTML, like Gecko) Chrome/<Chrome Rev>
Safari/<WebKit Rev>
Here's an example of the Chrome user agent string on a Galaxy Nexus:
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B)
AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile
Safari/535.19
For comparison, here are examples of other popular user agent strings:
Desktop Chrome: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19
Desktop Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10
iPhone Safari: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3
iPad Safari: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
For more information about Mobile Safari user agent strings, see this article.
User agent mechanics
Like all other browsers, Chrome for Android Beta sends this information in the User-Agent HTTP header every time it makes a request to any site. It’s also available in the client through JavaScript using the navigator.userAgent call.
If you are parsing user agent strings using regular expressions, the following can be used to check against Chrome for Android phones and Android tablets:
Phone pattern: 'Android' + 'Chrome/[.0-9]* Mobile'
Tablet pattern: 'Android' + 'Chrome/[.0-9]* (?!Mobile)'
Google Chrome
Google Chrome for Android
▾
Documentation
Overview
Remote Debugging
User Agent
FAQ
Chrome for Android User-Agent
Chrome for Android reports its user agent string (UA) in the following formats, depending on whether the device is a phone or a tablet:
Phone UA:
Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>)
AppleWebKit/<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Mobile
Safari/<WebKit Rev>
Tablet UA:
Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>)
AppleWebKit/<WebKit Rev>(KHTML, like Gecko) Chrome/<Chrome Rev>
Safari/<WebKit Rev>
Here's an example of the Chrome user agent string on a Galaxy Nexus:
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B)
AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile
Safari/535.19
For comparison, here are examples of other popular user agent strings:
Desktop Chrome: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19
Desktop Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10
iPhone Safari: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3
iPad Safari: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
For more information about Mobile Safari user agent strings, see this article.
User agent mechanics
Like all other browsers, Chrome for Android Beta sends this information in the User-Agent HTTP header every time it makes a request to any site. It’s also available in the client through JavaScript using the navigator.userAgent call.
If you are parsing user agent strings using regular expressions, the following can be used to check against Chrome for Android phones and Android tablets:
Phone pattern: 'Android' + 'Chrome/[.0-9]* Mobile'
Tablet pattern: 'Android' + 'Chrome/[.0-9]* (?!Mobile)'
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer