如文档中所述在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="*" />
否则,您会看到一条错误消息,告诉您未找到任何可处理意图的活动
ActivityNotFoundException: No Activity found to handle Intent
如果需要允许使用网页,请考虑添加
<allow-intent href="http://*/*" /> <allow-intent href="https://*/*" />
代替。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句