Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ class CanvasWebView @JvmOverloads constructor(
//try to find fallback url
val fallbackUrl = appIntent.getStringExtra("browser_fallback_url")
if (fallbackUrl != null) {
view.loadUrl(fallbackUrl, extraHeaders)
val fallbackScheme = Uri.parse(fallbackUrl).scheme?.lowercase()
if (fallbackScheme == "http" || fallbackScheme == "https") {
view.loadUrl(fallbackUrl, extraHeaders)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When fallbackScheme is neither "http" nor "https", the fallback URL is silently dropped and return true consumes the navigation event — the user gets a broken experience with no indication of what happened. Consider adding a warning log here to aid future debugging:

} else {
    Log.w("CanvasWebView", "Blocked unsafe fallback URL scheme: $fallbackScheme")
}

This doesn't need to be user-visible, but a logcat entry would make it much easier to diagnose reports of broken intent-fallback navigation in the field.

return true
}
} catch (e: URISyntaxException) {
Expand Down
Loading