大佬教程收集整理的这篇文章主要介绍了php – 仅使用“桌面模式”浏览器检测移动用户,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.appVersion)[1],10); // also matches AppleWebKit var isGoogle = webkitVer && navigator.vendor.indexOf('Google') === 0; // Also true for Opera Mobile and maybe others var isAndroid = isGoogle && userAgent.indexOf('Android'); // Careful - Firefox and Windows Mobile also have Android in user agent var androidDesktopMode = !isAndroid && isGoogle && navigator.platform.indexOf('Linux ') === 0 && !(window.chrome || window.chrome.webstorE) && 'ontouchstart' in document.documentElement;@H_489_2@这通常应该有效,尽管某些浏览器可能会失败(AOSP?基于Blink的移动浏览器?). @H_489_2@对于Windows Mobile,您可以通过检查字符串“WPDesktop;”来检测桌面模式.在用户代理中.
以上是大佬教程为你收集整理的php – 仅使用“桌面模式”浏览器检测移动用户全部内容,希望文章能够帮你解决php – 仅使用“桌面模式”浏览器检测移动用户所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。