/**
* 得到原始的useragent
*/
NSString *oldAgent = [self.webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
/**
* 在后面添加你要追加的字符串
*/
NSString *newAgent = [oldAgent stringByAppendingString:@"你要追加的字符串"];
/**
注册新的usergent
*/
NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:newAgent, @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];