乱码时光

个人收藏夹

Javascript 判断是否微信、安卓、iOS

2019-11-14 admin

const u = navigator.userAgent
const isWechat = u.indexOf('MicroMessenger') > -1
const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1
const isiOS = u.indexOf('iPhone') > -1 || u.indexOf('iPad') > -1