Skip to content

Commit

Permalink
add warning around androidScheme with Android webview 117
Browse files Browse the repository at this point in the history
  • Loading branch information
dallastjames committed Oct 10, 2023
1 parent 79e17bb commit ff79699
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ private boolean validateScheme(String scheme) {
return false;
}

// Non-http(s) schemes are not allowed to modify the URL path as of Android Webview 117
if (!scheme.equals("http") && !scheme.equals("https")) {
Logger.warn(
"Using a non-standard scheme: " + scheme + " for Android. This is known to cause issues as of Android Webview 117."
);
}

return true;
}

Expand Down
5 changes: 5 additions & 0 deletions cli/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ export interface CapacitorConfig {
/**
* Configure the local scheme on Android.
*
* Custom schemes on Android are unable to change the URL path as of Webview 117. Changing this value from anything other than `http` or `https` can result in your
* application unable to resolve routing. If you must change this for some reason, consider using a hash-based url strategy, but there are no guarentees that this
* will continue to work long term as allowing non-standard schemes to modify query parameters and url fragments is only allowed for compatibility reasons.
* https://chromium-review.googlesource.com/c/chromium/src/+/4701743
*
* @since 1.2.0
* @default https
*/
Expand Down

0 comments on commit ff79699

Please sign in to comment.