androidgoogle-chromeandroid-intentupichrome-for-android

Chrome on Android shows "Navigation is blocked" when user clicks on generic upi intent link


On a specific subset of Android devices on Chrome stable version 110, when trying to open a generic UPI intent "upi://...", Chrome blocks navigation and prints a "Navigation is blocked" error on console. The expected behaviour is that an intent tray of UPI apps show up, or directly opens the user's default UPI app.

I'm using a simple anchor tag with the intent on which the user clicks:

<a href="upi://....">Pay with any UPI app</a>

As per the Chrome behaviour on Android, this is very similar behaviour to what happens in case of programmatic (non user-initiated) redirects to intents. As per the Chrome docs there are only two cases in which Chrome will block navigation -

  1. For redirects from typed URLs.
  2. For redirects without user gesture.

My issue falls into none of these categories. Is there any other scenario in which Chrome can block such redirection on Android? Can user/browser settings or permissions affect this issue? (Is there a workaround even with the user following recommended settings)

Notes:

  1. App specific intents do work and open the specific app. It's only the generic intent that shows this issue.
  2. As per the user reports, this issue was not there earlier, and has surfaced after a recent Chrome update.
  3. Other intents also work fine, like playstore intents: market://
  4. This issue only shows up on a specific subset on Android devices and it works fine on other devices with the exact same Chrome version.

I've tried all possible solutions I could find so far, but nothing seems to work. Here are a list of things I tried: (In order of higher optimism that it would fix the issue):

  1. Modifying the intent from custom scheme format "upi://..." to the native Android intent format like so: "intent://#Intent;scheme=upi;...end;" as per best practices discussed in this blog and it seems this fix worked for some.
  2. Adding rel="noopener" or rel="noreferrer" to the <a> tag. This seems to be another resolution for similar issues.
  3. User allowing popup and redirects setting on Chrome on his mobile. (Although this isn't recommended by Chrome, no surprises)
  4. Trying different approaches to open the link, like a <button> instead of an <a> tag. Even with buttons, I tried different methods of redirection like window.open() or setting document.location.href or window.location.href.

None of these work, please let me know if I could try anything else to get this thing working.


Solution

  • Update: So the underlying issue was Chrome on Android blocking intents that targeted non-exported activities (since version 99). So even if any UPI app installed on the user's phone had a non-exported intent filter for the "upi" scheme, it would block normal behaviour of "upi" deeplinks. This has been fixed in latest Chrome Canary release, and is due to be released with the next Chrome stable release on Android (version 112) following this chromium bug.