mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
Bug 1329288: Allow content policy consumers to identify contentPolicy checks from docshell
This commit is contained in:
parent
79fb0b8506
commit
9e52126f1a
3 changed files with 26 additions and 3 deletions
|
|
@ -80,6 +80,16 @@ var ContentPolicy = {
|
|||
|
||||
shouldLoad(policyType, contentLocation, requestOrigin,
|
||||
node, mimeTypeGuess, extra, requestPrincipal) {
|
||||
|
||||
// Loads of TYPE_DOCUMENT and TYPE_SUBDOCUMENT perform a ConPol check
|
||||
// within docshell as well as within the ContentSecurityManager. To avoid
|
||||
// duplicate evaluations we ignore ConPol checks performed within docShell.
|
||||
if (extra instanceof Ci.nsISupportsString) {
|
||||
if (extra.data === "conPolCheckFromDocShell") {
|
||||
return Ci.nsIContentPolicy.ACCEPT;
|
||||
}
|
||||
}
|
||||
|
||||
if (requestPrincipal &&
|
||||
Services.scriptSecurityManager.isSystemPrincipal(requestPrincipal)) {
|
||||
return Ci.nsIContentPolicy.ACCEPT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue