在ios7上检测移动Safari的官方方法是什么?如何检测ios 7中的移动Safari浏览器?
例如:
navigator.userAgent.match(/(iPod|iPhone|iPad)/)
&& navigator.userAgent.match(/AppleWebKit/)
&& navigator.userAgent.match(/OS 7/)
在ios7上检测移动Safari的官方方法是什么?如何检测ios 7中的移动Safari浏览器?
例如:
navigator.userAgent.match(/(iPod|iPhone|iPad)/)
&& navigator.userAgent.match(/AppleWebKit/)
&& navigator.userAgent.match(/OS 7/)
尝试此
navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)
试试这个(检测的iPod touch以及):
navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_\d/i)
感谢您的解决方案 – Viktor