【问题标题】:Error while accessing iframe from chorme extension, content_security_policy error从 chrome 扩展访问 iframe 时出错,content_security_policy 错误
【发布时间】:2021-08-13 22:51:06
【问题描述】:

我正在尝试从 chrome 插件访问 iframe 并收到以下错误。

拒绝构建“https://mysite.co/”,因为祖先违反了以下内容安全策略指令:“frame-ancestors *”。

我已经在我的 menifest.json 文件中添加了以下行,但它不起作用。

"content_security_policy": "script-src 'self' https://mysite.co/"

请指导。

【问题讨论】:

    标签: javascript google-chrome-extension google-chrome-app content-security-policy chrome-plugins


    【解决方案1】:

    我找到了解决方案,我必须为 iframe 添加child-src,如下所示。

    "content_security_policy": "script-src 'self' https://mysite.co; child-src https://mysite.co; object-src 'self'"
    

    【讨论】:

      猜你喜欢
      • 2012-10-27
      • 2017-10-22
      • 2013-03-15
      • 2012-07-08
      • 1970-01-01
      • 2011-04-25
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      相关资源
      最近更新 更多