mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Make it possible to disable checkloaduri on a per-site basis instead of
disabling it globally. Bug 233108, r=caillon, sr=jst
This commit is contained in:
parent
a786894a90
commit
1f629aef08
@ -1296,6 +1296,21 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
|
||||
sourceScheme.EqualsLiteral("resource"))
|
||||
return NS_OK;
|
||||
|
||||
// Now check capability policies
|
||||
static const char loadURIPrefGroup[] = "checkloaduri";
|
||||
|
||||
SecurityLevel secLevel;
|
||||
rv = LookupPolicy(aPrincipal,
|
||||
(char*)loadURIPrefGroup,
|
||||
sEnabledID,
|
||||
nsIXPCSecurityManager::ACCESS_GET_PROPERTY,
|
||||
nsnull, &secLevel);
|
||||
if (NS_SUCCEEDED(rv) && secLevel.level == SCRIPT_SECURITY_ALL_ACCESS)
|
||||
{
|
||||
// OK for this site!
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
ReportError(nsnull, errorTag, sourceURI, aTargetURI);
|
||||
return NS_ERROR_DOM_BAD_URI;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user