- (void)setUserAgent{
__block NSString *userAgent=@"";
[self.webView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
userAgent =result;
NSString *newUserAgent = [userAgent stringByAppendingString:@" ;dzg"];
self.webView.navigationDelegate = self;
[self.webView setCustomUserAgent:newUserAgent];
}];
}
网友评论