[英]ipad cordova whitelist rejection
我尝试访问本地URL,通过IIS
公开应用程序( http://<localip>:<port>
),我可以使用iPad浏览器访问它。
移动应用程序使用WebViewer显示URL。
第一个问题是与https相关的“传输安全策略”(本地站点未通过SSL公开),但我可以解决在config.xml中添加以下行的问题
<config-file platform="ios" target="*-Info.plist" parent="">
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</config-file>
第二个问题是白名单,它阻止访问本地URL。 我添加了插件cordova-plugin-whitelist
在我添加的config.xml中
<config-file platform="ios" target="*-Info.plist" parent="">
<key>ExternalHosts</key>
<array>
<string>*</string>
</array>
</config-file>
和
<preference name="OpenAllWhitelistURLsInWebView" value="true" />
但它没有用
在config.xml中也有行
<access origin="*"/>
<allow-navigation href="*"/>
<allow-intent href="*"/>
但我认为它与android有关
我也试试
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
在index.html中,但不起作用
有人知道我还能尝试什么吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.