What is the best way to determine iOS 7 Safari user agent?

自闭症网瘾萝莉.ら 提交于 2019-12-10 21:52:47

问题


I'm having a styling issue that only exists in the iOS 7 versions of Safari. I have been unable to determine how to detect if the user is on that device with CSS Media queries or what the exact user agents are for iOS 7 devices.

Any help?


回答1:


Just try:

navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)



回答2:


IPhone/iOS7 user agent string looks like this:

Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53


来源:https://stackoverflow.com/questions/19012641/what-is-the-best-way-to-determine-ios-7-safari-user-agent

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