从 chorme 扩展访问 iframe 时出错,content_security_policy 错误

问题描述

我正在尝试从 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'"

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...