Chrome 25 iframe configure don 'twork protocol

I have a protocol (e.g. http) with a scheme managed by a third-party application registered in android. Ie, someapp: // some kind of action or something like that.

before updating chrome to the latest version (chrome 25), it works fine, but after updating it does not work.

I just use an iframe to try downloading the registered application. here is my snapshot of the code.

<iframe src="about:blank" id="myframe"/> <script> function changesrc(){ document.getElementById("myframe").src="someapp://someaction" } </script> 

any ideas for this problem?

+4
source share
1 answer

We believe this is a potential security or malicious threat and will no longer be implemented in Chrome. See https://code.google.com/p/chromium/issues/detail?id=169204#c27 for more details.

There is a solution, you can create a special intent URL that the user can call.

The basic intent-based URI syntax is as follows:

 "intent:" HOST/URI-path ";" // Optional "#Intent;" package=[string]; action=[string]; category=[string]; component=[string]; scheme=[string]; ";end" 

Analysis details available on the Android device.

To run the Zxing barcode scanner application, you can encode href as follows: // scan / # Intent; schem = zxing; package = com.google.zxing.client.android; href completion anchored properly Take qr code

Extracted from: https://code.google.com/p/zxing/source/browse/trunk/android/AndroidManifest.xml#97

The Android manifest defines the scheme as "zxing", the package "com.google.zxing.client.android" and the host data that will be "scanned". When the user clicks on this link, they go directly to the application, if they are already installed, or if they are not directly in the play store.

+2
source

All Articles