我可以通过/System/Library/Frameworks/Webkit/Resource/info.plist查看webkit版本,但是如何知道是否安装了safari 5,没有相应的矩阵告诉Webkit的版本,之后Safari 5是发货?
答案 0 :(得分:1)
使用它来检查webkit版本,基本上保证了safari版本
NSString* webkitPath = @"/System/Library/Frameworks/WebKit.framework/Resources/Info.plist";
NSDictionary* webkitDict = [NSDictionary dictionaryWithContentsOfFile:webkitPath];
NSString* versionString = [webkitDict valueForKey:@"CFBundleVersion"];
int vs = [versionString intValue];
int version = vs % 1000; // removing first digit which tells supported OS version number
// using this page for reference http://en.wikipedia.org/wiki/Safari_version_history
if (version < 533) // safari 5 shipped with 533
答案 1 :(得分:-1)
运行safari并点击Safari - 关于Safari