Intent在android chrome应用程序版本40中不起作用

Intent在android chrome应用程序版本40中不起作用,android,android-intent,Android,Android Intent,Intent在android chrome版本38之前一直正常工作,但在升级到版本40后,Intent无法正常工作 if ( this.browser == "android+chrome/25+" ) { var chromeUrl = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"; //All of syntax works well in chrome 38

Intent在android chrome版本38之前一直正常工作,但在升级到版本40后,Intent无法正常工作

if ( this.browser == "android+chrome/25+" ) {
    var chromeUrl = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end";

    //All of syntax works well in chrome 38.
    //But, some syntax not work in chrome 40.
    window.open(chromeUrl);     // --> works well, but this brings up a pop-up screen
    window.location = chromeUrl;        // --> ERROR : ERR_UNKNOWN_URL_SCHEME
    window.location(chromeUrl);         // --> ERROR : ERR_UNKNOWN_URL_SCHEME
    window.location.href = chromeUrl;   // --> ERROR : ERR_UNKNOWN_URL_SCHEME
    window.location.href(chromeUrl);    // --> ERROR : ERR_UNKNOWN_URL_SCHEME

} else {
我不想弹出一个屏幕


我需要你的帮助。谢谢。

我想我刚刚在chromium issue tracker上回答了您的问题。问题在铬问题跟踪程序上

带有“解决方法”的响应,粘贴自问题:

好的,我发现window.location通过intent重定向将 工作,只要从外部源或上的链接单击即可 页如果手动将重定向页面的地址输入到 地址栏,应用程序的重定向/打开将失败 错误

因此,通过电子邮件或短信发送指向重定向页面的链接将有效 当用户点击链接时,一切正常。手动键入地址 进入地址栏将失败<代码>window.location=chromeUrl应该 工作很好