如何在使用addon sdk时将内容安全策略添加到firefox扩展?

时间:2015-01-05 11:29:21

标签: javascript firefox iframe

我使用firefox附加sdk将我的chrome扩展转换为firefox插件。但我收到Content Security Policy: The page's settings blocked the loading of a resource at data:text/html;charset=utf-8错误。我在this link之后在iframe中注入了一个本地html。知道怎么做到这一点?对于chrome扩展,我跟着this link

1 个答案:

答案 0 :(得分:0)

我找到了一个适合我的解决方案。

我在package.json中添加以下行:

"permissions": {
    "cross-domain-content": ["https://www.foo.com/"]
},

https://www.foo.com您可以在其中添加您要访问的域或域列表。

有关详细信息,请转到Cross Domain Content Scripts