apache / apache/cordova-plugin-inappbrowser

Properly handle custom URL schemes?

Open
#289 5 comments 6 reactions 0 assignees View on GitHub
platform: android support topic: custom-url-schemes
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

It seems that custom URL schemes are not correctly handled, at least on Android.

For example, this plugin (https://github.com/EddyVerbruggen/Custom-URL-scheme) suggests that users use a forked version of the in app browser to handle these custom URL schemes (
https://github.com/Innovation-District/cordova-plugin-inappbrowser).

The problem is that an in-app-browser & custom URL scheme setup is particularly useful for OAuth authentications in Cordova apps. So trusting some random fork of the In App Browser plugin for these security sensitive use cases seems like a bad idea.

From looking at the source code for In App Browser, it seems that it additionally rejects custom URL schemes and attempts to re-write them, seemingly making intercepting the custom url scheme page loads with the 'loadstart' event not possible: http://git.lunargravity.be/project/Dag-secret-calculator/blob/3587c7a66a932c7de7183776880a55b4047eeb78/plugins/cordova-plugin-inappbrowser/src/android/InAppBrowser.java#L872

To be clear, this only appears to be an issue on android - for whatever reason iOS is perfectly happy loading custom URL schemes from the In App Browser.

Contributor guide

Open the contributing guide

Research direction

Inspect src/android/InAppBrowser.java around line 872 and compare the Android behavior with the iOS behavior described in the issue. Reproduce a custom URL scheme navigation and check whether the loadstart event can observe it; done means Android no longer exhibits the reported rejection or rewriting and the expected event behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, ios, java, javascript
Domain
authentication, 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.