JavaScript 判断 Android 还是 iOS
JavaScript About 442 wordsAndroid
function android() {
return /Android/i.test(navigator.userAgent)
}
iOS
function iOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
// iPad on iOS 13 detection
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document)
}
参考
Views: 1,032 · Posted: 2021-06-24
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...