Bug 821850 - Let nsExpandedPrincipal through CheckFunctionAccess. r=bz

Otherwise the whole method borks when it discovers that the principal doesn't
have a URI.
This commit is contained in:
Bobby Holley 2013-02-08 14:24:20 +00:00
parent fd02fd27ef
commit a2d9d906cb

View File

@ -1692,6 +1692,14 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
return NS_OK;
}
// Same thing for nsExpandedPrincipal, which is pseudo-privileged.
nsCOMPtr<nsIExpandedPrincipal> ep = do_QueryInterface(aPrincipal);
if (ep)
{
*result = true;
return NS_OK;
}
//-- See if the current window allows JS execution
nsIScriptContext *scriptContext = GetScriptContext(cx);
if (!scriptContext) {