@@ -1069,22 +1069,30 @@ - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigati
10691069 // Call the decision handler to allow to load web page.
10701070 decisionHandler (WKNavigationActionPolicyAllow );
10711071}
1072+
10721073- (void )webView : (WKWebView *)webView decidePolicyForNavigationResponse : (WKNavigationResponse *)navigationResponse decisionHandler : (void (^)(WKNavigationResponsePolicy ))decisionHandler {
10731074 decisionHandler (WKNavigationResponsePolicyAllow );
10741075}
1076+
10751077- (void )webView : (WKWebView *)webView didStartProvisionalNavigation : (null_unspecified WKNavigation *)navigation {
10761078 [self _didStartLoadWithObj: navigation];
10771079}
1078- - (void )webView : (WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation : (null_unspecified WKNavigation *)navigation {
1079- }
1080- - (void )webView : (WKWebView *)webView didFailProvisionalNavigation : (null_unspecified WKNavigation *)navigation withError : (NSError *)error {
1081- }
1082- - (void )webView : (WKWebView *)webView didCommitNavigation : (null_unspecified WKNavigation *)navigation {
1083- }
1080+
1081+ - (void )webView : (WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation : (null_unspecified WKNavigation *)navigation {}
1082+
1083+ - (void )webView : (WKWebView *)webView didFailProvisionalNavigation : (null_unspecified WKNavigation *)navigation withError : (NSError *)error {}
1084+
1085+ - (void )webView : (WKWebView *)webView didCommitNavigation : (null_unspecified WKNavigation *)navigation {}
1086+
10841087- (void )webView : (WKWebView *)webView didFinishNavigation : (null_unspecified WKNavigation *)navigation {
10851088 [self didFinishLoad ];
10861089}
10871090- (void )webView : (WKWebView *)webView didFailNavigation : (null_unspecified WKNavigation *)navigation withError : (NSError *)error {
1091+ if (error.code == NSURLErrorCancelled) {
1092+ [webView reloadFromOrigin ];
1093+ return ;
1094+ }
1095+ // id _request = [navigation valueForKeyPath:@"_request"];
10881096 [self didFailLoadWithError: error];
10891097}
10901098- (void )webView : (WKWebView *)webView didReceiveAuthenticationChallenge : (NSURLAuthenticationChallenge *)challenge completionHandler : (void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *__nullable credential))completionHandler {
0 commit comments