Skip to content

Commit

Permalink
remove UIWebView APIs (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanieBob authored and dequan1331 committed Dec 14, 2019
1 parent 78d7c58 commit 01200dc
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,6 @@ + (void)configCustomUAWithType:(ConfigUAType)type
#pragma clang diagnostic pop
}

//优先使用WKWebView,防止UIWebView iOS12 Crash
if (!originalUserAgent || originalUserAgent.length <= 0) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
UIWebView *webView;
@try {
webView = [[UIWebView alloc] init];
#pragma clang diagnostic pop
} @catch (NSException *exception) {
HPKErrorLog(@"fail to initialize UIWebView.");
}
originalUserAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
}

NSString *appUserAgent =
[NSString stringWithFormat:@"%@-%@", originalUserAgent, customString];
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:appUserAgent, @"UserAgent", nil];
Expand Down

0 comments on commit 01200dc

Please sign in to comment.