apache / apache/cordova-plugin-inappbrowser

Failed to open local html after assigned scheme app:// in config.xml in iOS

Open
#732 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
After upgraded to cordova-ios@6.0.0. In order to fix CORS issues "because of the strict security policies that WKWebView has applied to the file scheme...by setting the preference options scheme and hostname in the config.xml file."
```

```

I can't use IAB to open local html file as
iab.open('local-url.html');

## Problem
It will **navigateTo** "app://localhost/local-url.html" inside IAB
and reject to open html.
debug console reported "webView: didFailProvisionNavigation - -1--2: unsupported URL"

removed above two preferences, the 'local-url.html' can be open but I encounter the CORS problem!

### What is expected to happen?
'local-url.html' should be open when app:// scheme assigned

### What does actually happen?
failed to open

## Information

app:// scheme assigned was according cordova's[ blog](https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html)

### Command or Code

### Environment, Platform, Device

### Version information

## 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

Reproduce the failure using the config.xml scheme and hostname preferences, then call iab.open('local-url.html') and inspect the unsupported-URL result. Trace how the iOS InAppBrowser handles the resulting app://localhost/local-url.html navigation; done means the local HTML opens while the assigned app:// scheme remains enabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.