这是 Facebook for iOS WebView 用户代理吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11414006/
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-08-30 19:12:38  来源:igfitidea点击:

Is this a Facebook for iOS WebView User Agent?

iphoneiosfacebookipadwebkit

提问by Jim Rubenstein

I'm looking through some logs trying to explain some "interesting" behavior and I'm seeing some users come to my application with a user agent similar to this one:

我正在查看一些日志,试图解释一些“有趣”的行为,我看到一些用户带着类似于这个的用户代理来到我的应用程序:

Mozilla/5.0 (iPad; U; CPU iPhone OS 5_1_1 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.1.1;FBBV/4110.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.1.1;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]

If I run this string through udger.comI get the following result:

如果我通过udger.com运行此字符串,则会得到以下结果:

user agent screenshot

用户代理截图

This screen shot and user agent confuses me because it says it's the mobile safari for iPod and iPad. I see iPadin the first part of the user-agent, but I also see a lot of references to FB and iPhone and iOS and all kinds of other things.

这个屏幕截图和用户代理让我感到困惑,因为它说它是 iPod 和 iPad 的移动 safari。我iPad在用户代理的第一部分看到了,但我也看到了很多对 FB、iPhone 和 iOS 以及各种其他东西的引用。

I'm curious if this is a "generic" user-agent that is served up by the Facebook for iOS application, and if it is - is the device an iPad or is it just not clear enough to tell?

我很好奇这是否是 Facebook 为 iOS 应用程序提供的“通用”用户代理,如果是 - 该设备是 iPad 还是不够清楚?

回答by Christopher Hackett

Yes it is the iOS Facebook app....

是的,它是 iOS Facebook 应用程序....

The following is the user agent string from an iPhone 4s showing that it includes the correct device iPhone4,1

以下是来自 iPhone 4s 的用户代理字符串,显示它包含正确的设备 iPhone4,1

Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X)
AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A523
[FBAN/FBIOS;FBAV/5.3;FBBV/89182;FBDV/iPhone4,1;FBMD/iPhone;FBSN/iPhoneOS;
FBSV/6.0.1;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US]

The devices shown seem to follow the same model identification shown in an answer on detecting iOS models

显示的设备似乎与检测 iOS 型号的答案中显示的型号标识相同

@"i386"      on the simulator
@"iPod1,1"   on iPod Touch
@"iPod2,1"   on iPod Touch Second Generation
@"iPod3,1"   on iPod Touch Third Generation
@"iPod4,1"   on iPod Touch Fourth Generation
@"iPhone1,1" on iPhone
@"iPhone1,2" on iPhone 3G
@"iPhone2,1" on iPhone 3GS
@"iPad1,1"   on iPad
@"iPad2,1"   on iPad 2
@"iPad3,1"   on iPad 3 (aka new iPad)
@"iPhone3,1" on iPhone 4
@"iPhone4,1" on iPhone 4S
@"iPhone5,1" on iPhone 5
@"iPhone5,2" on iPhone 5

This means the string you show that it was an the facebook app on iPad 2

这意味着您显示的字符串是iPad 2上的 facebook 应用程序