问题
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