apache / apache/cordova-plugin-inappbrowser

Decide policy on load error

Open
#799 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

# Decide policy on load error

## Errors like WebKitErrorDomain (error code 102) and others interrupt the navigation process. In such cases navigation decisions should be made rather than rejected.

### It would be useful to handle any errors in the loaderror method handler on the js side and make decisions about further navigation.

### My problem appears when beforeload was added and after several get requests followed by a post request in inappbrowser.

The problem was solved by changing the following code:
```
- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(nonnull NSError *)error
{
if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102)
return;
else
[self webView:theWebView failedNavigation:@"didFailProvisionalNavigation" withError:error];
}
```

Contributor guide

Open the contributing guide

Research direction

Start at the iOS WKWebView delegate method didFailProvisionalNavigation and trace how navigation failures become the JavaScript loaderror event. Define the desired navigation-decision policy for WebKitErrorDomain code 102 and other load errors, including what completion should look like; the issue does not name a test or file beyond this entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, objective-c
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.