apache / apache/cordova-plugin-inappbrowser

Error not logged or caught, didFailProvisionalLoadForFrame code = 102

Open
#855 0 comments 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

# Bug Report
When trying to load a PDF in iOS, the inappbrowser just showed a blank white page. I added an event listener for 'loaderror' but it was never called. I noticed in the XCode logs that it was throwing `didFailProvisionalLoadForFrame code = 102`. I ultimately discovered that the mimetype of the pdf response was incorrect (`application/octet-stream` instead of `application/pdf`) but the debugging experience should be improved

### What is expected to happen?
InAppBrowser should catch that error and throw it in the `loaderror` event

### What does actually happen?
I just see a blank white page and no debug information outside of xcode

## Information

2021-03-03 14:40:32.475590-0500 MyApp[84143:3442282] [Process] 0x7fcfec057a20 - [pageProxyID=20, webPageID=21, PID=85174] WebPageProxy::didFailProvisionalLoadForFrame: frameID = 3, domain = WebKitErrorDomain, code = 102
2021-03-03 14:40:32.475801-0500 MyApp[84143:3442282] webView:didFailProvisionalNavigation - 102: Frame load interrupted

### Command or Code

### Environment, Platform, Device

cordova-ios@6.2.0
cordova-plugin-inappbrowser@5.0.0
ios@14.4

made using a CORS request (if that matters)

### Version information

Cordova CLI @10.0.0

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start at the iOS webView:didFailProvisionalNavigation callback and reproduce the PDF load with application/octet-stream on iOS 14.4. Done means the InAppBrowser reports the failed load through the loaderror event instead of leaving a blank page with details only in Xcode.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.