在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