javascript iPhone 8、iPhone 8 Plus 和 iPhone X 的用户代理字符串是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46261031/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 06:33:15  来源:igfitidea点击:

What would be the User Agent string for iPhone 8, iPhone 8 Plus and iPhone X?

javascriptiphoneuser-agentiphone-x

提问by Tushar Vaghela

In a device detection, what would be the user agent for the new iPhone 8, iPhone 8 Plus and iPhone X?

在设备检测中,新 iPhone 8、iPhone 8 Plus 和 iPhone X 的用户代理是什么?

回答by Tamás Sengel

Here is the user agent string for them:

这是他们的用户代理字符串:

Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

Source:

来源:

The iOS 11 GM firmware model number is 15A372, which will very likely be the same as the model number of the final iOS 11.

iOS 11 GM 固件型号为15A372,很可能与最终 iOS 11 的型号相同。

Here is a user agentfrom a beta version of iOS 11, which has the AppleWebKit and Safari version number.

这是iOS 11 测试版的用户代理,它具有 AppleWebKit 和 Safari 版本号。

回答by Tushar Vaghela

As far as I know, user agent for iPhone 8, iPhone 8 plus and iPhone X are same. To detect device we need to check screen size of the device.

据我所知,iPhone 8、iPhone 8 plus 和 iPhone X 的用户代理是一样的。要检测设备,我们需要检查设备的屏幕尺寸。

iPhone 8 - (750px x 1334px)

iPhone 8 - (750px x 1334px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

iPhone 8 Plus - (1242px x 2208px)

iPhone 8 Plus - (1242px x 2208px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

iPhone X - (1125px x 2436px)

iPhone X - (1125px x 2436px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1