移动端常见内置浏览器的useragent

微信:

Mozilla/5.0 (Linux; Android 8.1.0; vivo X21A Build/OPM1.171019.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 XWEB/880 MMWEBSDK/190301 Mobile Safari/537.36 MMWEBID/15 MicroMessenger/7.0.4.1420(0x2700043C) Process/toolsmp NetType/WIFI Language/zh_CN

qq:

Mozilla/5.0 (Linux; Android 8.1.0; vivo X21A Build/OPM1.171019.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044704 Mobile Safari/537.36 V1_AND_SQ_8.0.7_1204_YYB_D QQ/8.0.7.4085 NetType/WIFI WebP/0.3.0 Pixel/1080 StatusBarHeight/84

支付宝:

Mozilla/5.0 (Linux; U; Android 6.0.1; zh-CN; C106-8 Build/ZDXCNCM5601409252S) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.3.8.909 UCBS/[图片上传失败...(image-87a55e-1510801415890)]2.10.0.5 Mobile Safari/537.36 Nebula AlipayDefined(nt:NotReachable,ws:411|731|2.625null) AliApp(AP/10.0.5.022801) AlipayClient/10.0.5.022801 Language/zh-Hans useStatusBar/true

判断方法:

function isInternalBrowser() {
      const ua = navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return "weixin";
      } else if (ua.indexOf(' qq') != -1 && ua.indexOf('mqqbrowser') != -1) {
        return "QQ";
      } else if (ua.match(/Alipay/i) == "alipay") {
        return "alipay";
      }
      return false;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值