What is the iPad user agent?

2019-01-02 17:58发布

From what I gather, the iPad is using iPhone OS, but with a different screen resolution from the iPhone and iPod touch. So many sites may have to change their user agent detection to adapt to the iPad.

So, can anyone with access to the iPad or the iPad SDK give us the user-agent string?

12条回答
谁念西风独自凉
2楼-- · 2019-01-02 18:35

Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10

查看更多
还给你的自由
3楼-- · 2019-01-02 18:35

iPad 2 under 4.3.5:

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

查看更多
闭嘴吧你
4楼-- · 2019-01-02 18:38

From Simulator 3.2 final:

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10

查看更多
墨雨无痕
5楼-- · 2019-01-02 18:39

I think it is worth mentioning that you don't generally need to use the whole agent string, unless perhaps you find a reason where you need to tailor the website to a specific model.

You can check for iPhone, iPad and iPod in the agent string and cover all your bases.

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
    appleMobileDevice = true;
}
else {
    appleMobileDevice = false;
}
查看更多
荒废的爱情
6楼-- · 2019-01-02 18:40

Here you go!

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

查看更多
素衣白纱
7楼-- · 2019-01-02 18:40

Safari on iPad user agent string in iPhone OS 3.2 SDK beta 3:

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

More info: http://developer.apple.com/library/safari/#technotes/tn2010/tn2262/_index.html

查看更多
登录 后发表回答