简体   繁体   English

无法使用 Javscript 识别 iPad Pro 设备

[英]Not able to identify iPad Pro devices by using Javscript

I am trying to identify iPad devices by using various methods in JS.我正在尝试通过在 JS 中使用各种方法来识别 iPad 设备。 As per the latest research on this, newer versions of iPad Pro behaving same as desktop versions(Same user agent).根据对此的最新研究,较新版本的 iPad Pro 的行为与桌面版本相同(相同的用户代理)。 Since both iPad and Mac shows same user agent details, it's very difficult to differentiate iPad and Mac devices.由于 iPad 和 Mac 都显示相同的用户代理详细信息,因此很难区分 iPad 和 Mac 设备。

Can anyone help on this?有人可以帮忙吗?

Thanks in advance提前致谢

You can try this way:你可以这样试试:

var isIPadPro = /Macintosh/.test(navigator.userAgent) && 'ontouchend' in document;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM