iPad version detection in JavaScript

前端 未结 9 777
耶瑟儿~
耶瑟儿~ 2020-12-06 11:12

Is it possible to check for the iPad version (1 or 2) in a web application? As the user agent looks identical (see http://www.webtrends.com/Support/KnowledgeBase/SolutionDet

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 11:57

    Sorry but currently there is no difference between iPad and iPad 2.

    See, there is no difference between the two of them:

    iPad:
     Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5
    
    iPad2:
     Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5
    

    And notice there, that the versions there are constantly changing in iOS updates.

    UPDATE

    Looks like there is a difference between them:

    iPad:
      Mobile/8F190
    
    iPad 2:
      Mobile/8F191
    
    iPad 3:
      Mobile/9B176 (according to Philipp)
    

提交回复
热议问题