From ff79699515be4e900d8df8563692dc3df24f171c Mon Sep 17 00:00:00 2001 From: Dallas James Date: Tue, 10 Oct 2023 15:46:24 -0500 Subject: [PATCH] add warning around androidScheme with Android webview 117 --- .../src/main/java/com/getcapacitor/CapConfig.java | 7 +++++++ cli/src/declarations.ts | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/android/capacitor/src/main/java/com/getcapacitor/CapConfig.java b/android/capacitor/src/main/java/com/getcapacitor/CapConfig.java index 2cfeb38fe..5320a4f08 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/CapConfig.java +++ b/android/capacitor/src/main/java/com/getcapacitor/CapConfig.java @@ -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; } diff --git a/cli/src/declarations.ts b/cli/src/declarations.ts index d128bdc47..d5e316421 100644 --- a/cli/src/declarations.ts +++ b/cli/src/declarations.ts @@ -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 */