Add ability to disable JS. Fix 13978 shopping at webvan.com crashes
git-svn-id: svn://10.0.0.236/trunk@47995 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -82,6 +82,15 @@ public:
|
||||
NS_SCRIPTSECURITYMANAGER_PROGID, &result);
|
||||
if (NS_FAILED(result))
|
||||
return NS_ERROR_FAILURE;
|
||||
PRBool hasPrincipal;
|
||||
if (NS_FAILED(securityManager->HasSubjectPrincipal(&hasPrincipal)))
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!hasPrincipal) {
|
||||
// Must be loaded as a result of a user action on a HTML element
|
||||
// with a javascript: HREF attribute
|
||||
// TODO: need to find URI of enclosing page
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_FAILED(securityManager->GetSubjectPrincipal(&mPrincipal)))
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
@@ -151,8 +160,9 @@ public:
|
||||
// Finally, we have everything needed to evaluate the expression.
|
||||
nsAutoString ret;
|
||||
PRBool isUndefined;
|
||||
rv = scriptContext->EvaluateString(nsString(jsExpr), mPrincipal,
|
||||
nsnull, 0, ret, &isUndefined);
|
||||
rv = scriptContext->EvaluateString(nsString(jsExpr), nsnull,
|
||||
mPrincipal, nsnull, 0, ret,
|
||||
&isUndefined);
|
||||
nsCRT::free(jsExpr);
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
|
||||
Reference in New Issue
Block a user