繁体   English   中英

拒绝加载 gap://ready 因为它没有出现在内容安全策略的 child-src 指令中

[英]Refused to load gap://ready because it does not appear in the child-src directive of the Content Security Policy

更新到新的 Xcode 后,我收到此错误:

Refused to load gap://ready because it does not appear in the child-src directive of the Content Security Policy.

这是 index.html 文件:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="Content-Security-Policy" content="worker-src blob:; child-src blob: ;default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">

  <meta name="theme-color" content="#A83AFA">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <title>My app</title>
</head>
<body>
  <div id="app"></div>
  <% if (process.env.TARGET === 'cordova') { %>
    <script src="version.js"></script>
    <script src="cordova.js"></script>
  <% } %>
</body>
</html>

这是完整的调试器日志:

在此处输入图片说明

你有gap:在default-src中,但你也必须将它添加到child-src中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM