簡體   English   中英

Cordova Config中的errorUrl在Android上不起作用

[英]errorUrl in Cordova Config not working on Android

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 platform部分中添加此值,因為這是android特定的。

另外請確保不要設置

 <allow-intent href="*" />

否則,您會看到一條錯誤消息,告訴您未找到任何可處理意圖的活動

ActivityNotFoundException: No Activity found to handle Intent

如果需要允許使用網頁,請考慮添加

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

代替。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM