Search code examples
javascriptandroidhtmlanchormobile-chrome

Prevent "Complete action using..." dialog in android's chrome, when tapping a link?


I've met this problem in Android's Chrome browser. When I try to open a link, which leads to google plus account, with target blank attribute:

<a href="http://plus.google.com" target="_blank">link</a>

It asks me to "Complete action using: "Chrome", "Google+" or "Native browser". And if I choose "Chrome", link is being opened in same tab.

Have anyone met this issue before? How to open this link in another tab instead of opening it in same tab or to prevent appearing of this dialog from JavaScript, or maybe, specific meta tags?


Solution

  • It's not working because the Google Plus app registered a custom URL handler for "//plus.google.com/", causing the "Complete with..." dialog, and then the context of the link, including its target attribute, no longer exists when it is externally rerouted to Chrome.

    I suspect this is actually a bug, but one that is hard to fix from Chrome's end. You could report it on their mailing lists. It's nothing you can fix from your end, as the Android native system's URL protocol handler is intervening in a way that you cannot circumvent from within the browser sandbox. Android itself is completely correct in showing the dialog, as there are 3 valid applications that can handle the link in question.