Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 生成后cordova安全内容出错_Ios_Cordova_Sencha Touch_Content Security Policy - Fatal编程技术网

Ios 生成后cordova安全内容出错

Ios 生成后cordova安全内容出错,ios,cordova,sencha-touch,content-security-policy,Ios,Cordova,Sencha Touch,Content Security Policy,我正在使用iOS中的混合cordova应用程序,在cordova的最新版本中,我将这一行添加到head标记中 当我在模拟器中构建或设备返回此错误时: 拒绝执行内联脚本,因为它违反了以下内容安全策略指令:“默认src“self”数据:间隙:https://ssl.gstatic.com “不安全评估”。请注意,没有显式设置“script src”,因此使用“default src”作为回退。 在与服务器交互时出现此错误,阻止ajax请求 我做错了什么?请帮忙 错误消息告诉您,您当前的内容安全策略

我正在使用iOS中的混合cordova应用程序,在cordova的最新版本中,我将这一行添加到
head
标记中

当我在模拟器中构建或设备返回此错误时:

拒绝执行内联脚本,因为它违反了以下内容安全策略指令:“默认src“self”数据:间隙:https://ssl.gstatic.com “不安全评估”。请注意,没有显式设置“script src”,因此使用“default src”作为回退。

在与服务器交互时出现此错误,阻止ajax请求


我做错了什么?请帮忙

错误消息告诉您,您当前的内容安全策略禁止向您发出请求的域发出请求,因为您尚未指定允许这样做。将其包括在CSP标签中:-

script-src https://yourajaxdomainhere
所以它变成了

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; script-src https://yourajaxdomainhere; media-src *">

还要确保将要向其发送请求的域作为允许的源添加到config.xml文件中

<access origin="https://yourajaxdomainhere" />

我已经卸载了“白名单”插件,但它不起作用。。还有什么更具体的步骤要遵循吗。。在我的config.xml中,我拥有的还不够吗?