gpt4 book ai didi

android - Intent 在 Android Chrome 应用程序版本 40 中不起作用

转载 作者:行者123 更新时间:2023-11-29 01:35:36 24 4
gpt4 key购买 nike

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 问题跟踪器中回答了你的问题。问题在 chromium 问题跟踪器上 here .

从问题中粘贴的“解决方法”的响应:

OK, I've found out that the window.location redirect via intent will work, AS LONG as it is clicked from an external source or link on page. If you manually enter the address of the redirect page into the address bar, the redirection / opening of the app will fail with said error.

So, sending a link to the redirect page in an email or SMS will work just fine when the user clicks the link. Manually typing the address into the address bar will fail. window.location = chromeUrl; should work just fine.

关于android - Intent 在 Android Chrome 应用程序版本 40 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28317561/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com