常见UserAgent整理
前言
UserAgent作为客户端与服务器之间交互的重要标识,对于了解用户设备信息、优化用户体验以及网站或应用的兼容性测试等方面都具有重要的意义。通过解析不同的UserAgent,我们可以更好地理解用户的需求和习惯,提供更个性化、优质的服务。随着移动互联网的普及和技术的不断进步,UserAgent的解析和识别将在未来的应用中发挥更大的作用。
使用
微信浏览器的UserAgent通常包含“MicroMessenger”这一关键词
下面是一个识别如果是微信客户端的浏览器,则自动跳转到默认浏览器的代码
const userAgent = navigator.userAgent.toLowerCase()
if (userAgent.indexOf('micromessenger') !== -1) {
const url = `http://www.iot2ai.top/cgi-bin/wxit/open.html?${window.location.href}`
alert(url)
window.location.href = url
}
这是一个判断是不是在某个APP里打开的页面的方法
export const webView = () => {
return /Feishu|DingTalk|MicroMessenger|Bytedance|NewsArticle|Zhihu|Weibo|AlipayClient|MQQBrowser/gi.test(window.navigator.userAgent);
};
常见 User-Agent
浏览器 | 设备 | UserAgent |
---|---|---|
飞书 | - | Mozilla/5.0 (Linux; Android 9; MI 6X Build/PKQ1.180904.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.156 Mobile Safari/537.36 Lark/5.10.4 LarkLocale/zh_CN ChannelName/Feishu TTWebView/0751130016452 |
钉钉 | - | Mozilla/5.0 (Linux; U; Android 12; zh-CN; M2102J2SC Build/SKQ1.211006.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.1.210 Mobile Safari/537.36 AliApp(DingTalk/6.5.20) com.alibaba.android.rimet/24646881 Channel/700159 language/zh-CN abi/64 UT4Aplus/0.2.25 colorScheme/light |
微信 | - | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4267 MMWEBSDK/20220505 Mobile Safari/537.36 MMWEBID/4029 MicroMessenger/8.0.23.2160(0x28001757) WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64 |
抖音 | - | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.156 Mobile Safari/537.36 aweme_210600 JsSdk/1.0 NetType/4G Channel/xiaomi_1128_64 AppName/aweme app_version/21.6.0 ByteLocale/zh-CN Region/CN AppSkin/black AppTheme/dark BytedanceWebview/d8a21c6 TTWebView/0751130025454 |
今日头条 | - | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36 JsSdk/2 NewsArticle/8.8.5 NetType/4g TTWebView/0881130037409 |
知乎 | - | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.104 Mobile Safari/537.36 ZhihuHybrid |
新浪微博 | - | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.104 Mobile Safari/537.36 Weibo (Xiaomi-Mi 10S__weibo__12.7.2__android__android12) |
支付宝 | - | Mozilla/5.0 (Linux; U; Android 12; zh-CN; M2102J2SC Build/SKQ1.211006.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.2.43 Mobile Safari/537.36 UCBS/3.22.2.43_220223200704 ChannelId(0) NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:4G,ws:393 |
- | Mozilla/5.0 (Linux; Android 12; M2102J2SC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/046011 Mobile Safari/537.36 V1_AND_SQ_8.8.98_3002_YYB_D A_8089800 PA QQ/8.8.98.8410 NetType/4G WebP/0.3.0 Pixel/1080 StatusBarHeight/90 SimpleUISwitch/1 QQTheme/2971 InMagicWin/0 StudyMode/0 CurrentMode/1 CurrentFontScale/1.0 GlobalDensityScale/0.9818182 AppId/537124039 | |
微信内置浏览器 | MacOS | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/6.8.0(0x16080000) MacWechat/3.8.6(0x13080611) XWEB/1152 Flue |
微信内置浏览器 | Windows | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090819) XWEB/8519 Flue |
微信内置浏览器 | Android | Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 XWEB/1160043 MMWEBSDK/20231105 MMWEBID/4478 MicroMessenger/8.0.44.2502(0x28002C51) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 |
微信小程序请求 | Android | Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 XWEB/1160043 MMWEBSDK/20231105 MMWEBID/4478 MicroMessenger/8.0.44.2502(0x28002C51) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android |
微信小程序WebView | Android | Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 XWEB/1160043 MMWEBSDK/20231105 MMWEBID/4478 MicroMessenger/8.0.44.2502(0x28002C51) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxdec51c0e2b06cbfe |
支付宝内置浏览器 | Android | Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/105.0.5195.148 MYWeb/0.11.0.231220162319 UWS/3.22.2.9999 UCBS/3.22.2.9999_220000000000 Mobile Safari/537.36 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:WIFI,ws:407 |
抖音内置浏览器 | Android | Mozilla/5.0 (Linux; Android 10; HD1900 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.156 Mobile Safari/537.36 aweme_230400 JsSdk/1.0 NetType/WIFI AppName/aweme app_version/23.4.0 ByteLocale/zh-CN Region/CN AppSkin/white AppTheme/light BytedanceWebview/d8a21c6 WebView/075113004008 |
QQ内置浏览器 | Android | Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.86 MQQBrowser/6.2 TBS/046905 Mobile Safari/537.36 V1_AND_SQ_9.0.0_5282_YYB_D PA QQ/9.0.0.14110 NetType/WIFI WebP/0.3.0 AppId/537194356 Pixel/1220 StatusBarHeight/89 SimpleUISwitch/1 QQTheme/2971 StudyMode/0 CurrentMode/1 CurrentFontScale/1.0 GlobalDensityScale/1.0166667 AllowLandscape/false InMagicWin/0 |
B站客户端 | MacOS | Mozilla/5.0 (iPad; CPU OS 16_6 like Mac OS X) AppleWebKit/615.3.12.11.2 (KHTML, like Gecko) Mobile/22G90 BiliApp/36601100 os/ios model/iPad Pro 12.9-Inch 3G mobi_app/ipad build/36601100 osVer/16.6 network/2 channel/AppStore Buvid/Y65AF76CD250F2FD5D938E938DAD17C8C306 c_locale/zh-Hans_CN s_locale/zh-Hans_CH sessionID/a95eff62 disable_rcmd/0 |
Chrome | MacOS | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 |
Chrome | Windows | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 |
Chrome | Android | Mozilla/5.0 (Linux; Android 6.0.1; SOV33 Build/35.0.D.0.326) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.91 Mobile Safari/537.36 |
Safari | iOS | Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1 |
博客中所涉及到的图片都有版权,请谨慎使用