Skip to content

[BUG] PrivacyPolicyActivity WebView does not route non http(s) links out of the WebView #5065

Done

Description

@jim-daf

PrivacyPolicyActivity (owncloudApp/src/main/java/com/owncloud/android/presentation/settings/privacypolicy/PrivacyPolicyActivity.kt) sets up its WebViewClient with only an onReceivedError override:

webViewClient = object : WebViewClient() {
    override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
        showMessageInSnackbar(message = getString(R.string.privacy_policy_error) + description)
    }
}

Because shouldOverrideUrlLoading is not overridden, every link the privacy policy page renders is loaded by the WebView itself. That has two visible effects:

  1. A mailto: link in the policy text opens nothing. The WebView tries to load mailto:foo@example.com itself, fails, and the mail app never opens.
  2. Any other non http(s) scheme that an app on the device could handle (tel:, geo:, intent:, market:) is swallowed by the WebView the same way instead of being handed to that app.

The page is remote (url_privacy_policy, https://owncloud.com/android-app-privacy-policy/ by default, and a branded build can point it somewhere else), so which links it contains is outside the app's control.

Suggested fix

Override shouldOverrideUrlLoading so http(s) navigations stay in the WebView and any other scheme is routed out. ActivityExt.kt already has goToUrl(url), which launches Intent.ACTION_VIEW inside a try/catch for ActivityNotFoundException and shows the file_list_no_app_for_perform_action snackbar, so a missing handler does not crash the Activity:

override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
    val url = request?.url ?: return false
    val scheme = url.scheme?.lowercase()
    if (scheme == "http" || scheme == "https") return false
    goToUrl(url.toString())
    return true
}

The same gap was fixed in the OpenCloud fork of this app in opencloud-eu/android#165.

Activity

  1. changed the title [-]PrivacyPolicyActivity WebView does not route non http(s) links out of the WebView[/-] [+][BUG] PrivacyPolicyActivity WebView does not route non http(s) links out of the WebView[/+] on Nov 26, 2026
  2. joragua commented on Nov 26, 2026

    @joragua
    Member

    Hi @jim-daf! Thanks for opening this issue! 🍻

    We will check this bug as soon as possible and try to fix it! Contributions are always welcome!

  3. self-assigned this
    on Nov 30, 2026
  4. jesmrec commented on Dec 2, 2026

    @jesmrec
    Member

    Fixed in #5068

    Will be part of the 5.0.0 incoming release.

    Thanks for reporting @jim-daf !

  5. added this to the 5.0 - Current milestone on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions