diff --git a/apple/RNCWebViewImpl.m b/apple/RNCWebViewImpl.m index c274399db..6a58db34c 100644 --- a/apple/RNCWebViewImpl.m +++ b/apple/RNCWebViewImpl.m @@ -1356,12 +1356,12 @@ - (void) webView:(WKWebView *)webView decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { WKNavigationResponsePolicy policy = WKNavigationResponsePolicyAllow; - if (_onHttpError && navigationResponse.forMainFrame) { + if (_onHttpError) { if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) { NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response; NSInteger statusCode = response.statusCode; - if (statusCode >= 400) { + if (statusCode >= 400 && navigationResponse.forMainFrame) { NSMutableDictionary *httpErrorEvent = [self baseEvent]; [httpErrorEvent addEntriesFromDictionary: @{ @"url": response.URL.absoluteString,