问题描述
我正在尝试从 chrome 插件访问 Iframe 并收到以下错误。
拒绝框架“https://mysite.co/”,因为祖先违反了以下内容安全政策指令:“frame-ancestors *”。
我已经在我的 menifest.json 文件中添加了以下行,但它不起作用。
"content_security_policy": "script-src 'self' https://mysite.co/"
请指导。
解决方法
我找到了解决方案,我必须为 iframe 添加 child-src
,如下所示。
"content_security_policy": "script-src 'self' https://mysite.co; child-src https://mysite.co; object-src 'self'"