如何将UIWebView识别为Safari

时间:2013-05-19 21:13:15

标签: ios uiwebview

您好我的UIWebView标识为Mozzila / 5.0(iPhone; CPU iPhone OS 6_1_2,如Mac OS X),Safari正在识别为Safari iOS6。我想用UIWebView加载的网页只支持Safari ...有哪些方法可以通过编程方式进行更改?我使用https://browsercheck.qualys.com/来检查浏览器..感谢您的回复!

1 个答案:

答案 0 :(得分:0)

更改网络浏览器的默认userAgent:

NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Apple-iPhone/501.347", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
[[NSUserDefaults standardUserDefaults] synchronize];

UserAgent list website

相关问题