mirror of
https://github.com/ManchildProductions/UXP-Fixed.git
synced 2026-05-29 18:24:47 +00:00
Bug 1329288: Allow content policy consumers to identify contentPolicy checks from docshell
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user