ipad cordova白名单拒绝

时间:2016-05-24 18:03:20

标签: ios cordova

我尝试访问本地网址,通过IIShttp://<localip>:<port>)公开应用程序,我可以通过iPad浏览器访问它。

移动应用程序使用WebViewer显示网址。

第一个问题是&#34;运输安全政策&#34;与https相关(本地站点未通过SSL公开),但我可以解决在config.xml中添加以下行

<config-file platform="ios" target="*-Info.plist" parent="">
   <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
</config-file>

第二个问题是白名单,它会阻止对本地网址的访问。 我添加了插件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中的

,但不起作用

有人知道我还能尝试什么吗?

0 个答案:

没有答案
相关问题