
获取UIWebView的useragent:
1 |
UIWebView* webView = [[UIWebView alloc] initWithFrame:CGRectZero]; |
附加自定义字段到 Useragent中
1 |
NSString *newUagent = [NSString stringWithFormat:@"%@ appname/3.5.2",secretAgent]; |
但应该注意的事,设置了useragent以后,需要过一段时间才能生效,所以一般是在appdelegate.m中就去改;如果在UIWebViewController初始化的时候再去更改的话,就有会导致有些请求还是原来的useragent




近期评论