Skip to content

Commit

Permalink
fix(WKWebView): Add "Frame load interrupted" error handling for OAuth (
Browse files Browse the repository at this point in the history
  • Loading branch information
oNaiPs authored and Titozzz committed Jan 11, 2019
1 parent cc1d735 commit 571aacb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/RNCWKWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,13 @@ - (void) webView:(WKWebView *)webView
return;
}

if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102) {
// Error code 102 "Frame load interrupted" is raised by the WKWebView
// when the URL is from an http redirect. This is a common pattern when
// implementing OAuth with a WebView.
return;
}

NSMutableDictionary<NSString *, id> *event = [self baseEvent];
[event addEntriesFromDictionary:@{
@"didFailProvisionalNavigation": @YES,
Expand Down

0 comments on commit 571aacb

Please sign in to comment.