Search code examples
manifestgoogle-chrome-appsandboxcontent-security-policy

In chrome packaged apps, Is there a way to declare multiple sandboxes, each one having its own content security policy?


I need to have sandboxes totally secured, others more "relaxed".

I tried this in the manifest.json (doesn't work, but describes accurately what I need to do):

...,

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

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

Unfortunately, I cannot find a way to have more than one content security policy for sandboxed pages.

The documentation shows how to implement the same CSP for multiple sandbox pages, but not how each sandbox could have its own CSP.

Is there any way to achieve this ?


Solution

  • Seems like it's not possible; "sandbox" is an object and can only have one "content_security_policy" key.

    Sounds like an idea for a feature request.