Request.Browser.IsMobileDevice not working with iPadAir2 and iOS 13.0.1

六月ゝ 毕业季﹏ 提交于 2019-12-18 17:30:10

问题


I am able to detect iPadAir2 device running on iOS 11.4 using Request.Browser.IsMobileDevice and it gives me UserAgent information saying its an iPad:

When I do same for iPadAir2 running on iOS 13.0.1 its not giving me iPad keyword anymore:

how do I detect its an ipad and ruuning a safari browser?

I need this to detect iPad in Razor .chtml page so I can show different Menu for my website.

I found this solution from here How to detect device name in Safari on iOS 13 while it doesn't show the correct user agent?

let isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)

How to use this variable in razor to change website menu ?

来源:https://stackoverflow.com/questions/58344491/request-browser-ismobiledevice-not-working-with-ipadair2-and-ios-13-0-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!