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 -
- For redirects from typed URLs.
- 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:
- App specific intents do work and open the specific app. It's only the generic intent that shows this issue.
- As per the user reports, this issue was not there earlier, and has surfaced after a recent Chrome update.
- Other intents also work fine, like playstore intents:
market://
- 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):
- 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. - Adding
rel="noopener"
orrel="noreferrer"
to the<a>
tag. This seems to be another resolution for similar issues. - User allowing popup and redirects setting on Chrome on his mobile. (Although this isn't recommended by Chrome, no surprises)
- Trying different approaches to open the link, like a
<button>
instead of an<a>
tag. Even with buttons, I tried different methods of redirection likewindow.open()
or settingdocument.location.href
orwindow.location.href
.
None of these work, please let me know if I could try anything else to get this thing working.