Bug 105050 - return null window.opener to scripts if opener is a mail window.
Bug 32571 - Prompt user before allowing scripts to close windows if opener is null. both r=heikki, sr=jst. git-svn-id: svn://10.0.0.236/trunk@114853 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1240,6 +1240,31 @@ nsScriptSecurityManager::GetSystemPrincipal(nsIPrincipal **result)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::SubjectPrincipalIsSystem(PRBool* aIsSystem)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSystem);
|
||||
*aIsSystem = PR_FALSE;
|
||||
|
||||
if (!mSystemPrincipal)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIPrincipal> subject;
|
||||
nsresult rv = GetSubjectPrincipal(getter_AddRefs(subject));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if(!subject)
|
||||
{
|
||||
// No subject principal means no JS is running;
|
||||
// this is the equivalent of system principal code
|
||||
*aIsSystem = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return mSystemPrincipal->Equals(subject, aIsSystem);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::GetCertificatePrincipal(const char* aCertID,
|
||||
nsIPrincipal **result)
|
||||
@@ -2677,7 +2702,6 @@ nsScriptSecurityManager::InitPrefs()
|
||||
PRUint32 prefCount;
|
||||
char** prefNames;
|
||||
|
||||
//-- Set a callback for policy changes
|
||||
// Registering the security manager as an observer to the
|
||||
// profile-after-change topic. We will build up the policy table
|
||||
// after the initial profile loads and after profile switches.
|
||||
|
||||
Reference in New Issue
Block a user