Bug 1930749 - Add option to Cu.Sandbox to specify CSP r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D228711
This commit is contained in:
@@ -497,9 +497,8 @@ bool nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(
|
||||
// Get the CSP for addon sandboxes. If the principal is expanded and has a
|
||||
// csp, we're probably in luck.
|
||||
auto* basePrin = BasePrincipal::Cast(subjectPrincipal);
|
||||
// ContentScriptAddonPolicy means it is also an expanded principal, thus
|
||||
// this is in a sandbox used as a content script.
|
||||
if (basePrin->ContentScriptAddonPolicy()) {
|
||||
// TODO bug 1548468: Move CSP off ExpandedPrincipal.
|
||||
if (basePrin->Is<ExpandedPrincipal>()) {
|
||||
basePrin->As<ExpandedPrincipal>()->GetCsp(getter_AddRefs(csp));
|
||||
}
|
||||
// don't do anything unless there's a CSP
|
||||
|
||||
Reference in New Issue
Block a user