iOS 设置 UIWebView UserAgent

 NSString *userAgent = [[[UIWebView alloc] init] stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];

    NSString *customUserAgent = [userAgent stringByAppendingFormat:@"%@", @"; xfq/1.0"];

    [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent":customUserAgent}];

你可能感兴趣的:(iOS 设置 UIWebView UserAgent)