wkwebview方法如下:
[webView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
NSString *string=result;
NSLog(@"result====%@",string);
}];
uiwebview方法如下:
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
NSString *string = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
时间: 2024-10-06 21:20:24