문제 설명
iOS 7 Safari 사용자 에이전트를 결정하는 가장 좋은 방법은 무엇입니까? (What is the best way to determine iOS 7 Safari user agent?)
iOS 7 버전의 Safari에만 존재하는 스타일 문제가 있습니다. 사용자가 CSS 미디어 쿼리를 사용하여 해당 기기에 있는지 감지하는 방법이나 iOS 7 기기에 대한 정확한 사용자 에이전트가 무엇인지 확인할 수 없습니다.
도움이 있습니까?
참조 솔루션
방법 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
(by bad_scott、Antonio MG、user2773289)