gpt4 book ai didi

javascript - Cordova 配置中的 errorUrl 在 Android 上不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 10:20:53 25 4
gpt4 key购买 nike

按照 docs 中所述在 config.xml 中设置 errorUrl 时,我会收到一个错误告诉我

CordovaWebViewImpl: showWebPage: Refusing to load URL into webview since it is not in the <allow-navigation> whitelist. URL=error.html

我会看到默认的 Android 错误页面。

最佳答案

对我来说,将网址更改为

<preference name="ErrorUrl" value="file:///android_asset/www/error.html" />

成功了。您应该在 android 平台部分添加此值,因为这是 android 特定的。

另外请确保未设置

 <allow-intent href="*" />

否则您会看到一条错误,告诉您没有找到处理 Intent 的 Activity

ActivityNotFoundException: No Activity found to handle Intent

如果您需要允许网页作为 Intent ,请考虑添加

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

相反。

关于javascript - Cordova 配置中的 errorUrl 在 Android 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51192735/

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