WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
/// 解决WKWebview跨域问题
[config.preferences setValue:@YES forKey:@"allowFileAccessFromFileURLs"];
if (@available(iOS 10.0, *)) {
[config setValue:@YES forKey:@"allowUniversalAccessFromFileURLs"];
}
网友评论