在chrome打包的应用程序中,有没有办法声明多个沙箱,每个沙箱都有自己的内容安全策略?

时间:2015-04-28 04:23:25

标签: manifest google-chrome-app sandbox content-security-policy

我需要完全保护沙箱,其他人则更“放松”。

我在manifest.json中尝试过此操作(不起作用,但准确描述了我需要做的事情):

...,

"sandbox": [
    {
    "pages":[
      "sandbox1.html"
      ],
    "content_security_policy": "<strict csp...>" 
    },

    {
    "pages":[
      "sandbox2.html"
      ],
    "content_security_policy": "<relaxed csp...>" 
    }
]

不幸的是,我无法找到一种方法来为沙盒页面提供多个内容安全策略。

documentation显示了如何为多个沙箱页面实现相同的 CSP,而不是每个沙箱如何拥有自己的CSP。

有没有办法实现这个目标?

1 个答案:

答案 0 :(得分:0)

似乎不可能; "sandbox"是一个对象,只能有一个"content_security_policy"密钥。

听起来像功能请求的想法。