Fix cross-origin access to the window.window getter. Bug 356474, r+sr=jst
git-svn-id: svn://10.0.0.236/trunk@213673 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -6377,11 +6377,19 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
|
||||
JSAutoRequest ar(cx);
|
||||
|
||||
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
||||
::JS_GetStringLength(str),
|
||||
OBJECT_TO_JSVAL(win->GetGlobalJSObject()),
|
||||
nsnull, nsnull,
|
||||
JSPROP_READONLY | JSPROP_ENUMERATE)) {
|
||||
PRBool doSecurityCheckInAddProperty = sDoSecurityCheckInAddProperty;
|
||||
sDoSecurityCheckInAddProperty = PR_FALSE;
|
||||
|
||||
PRBool ok =
|
||||
::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
||||
::JS_GetStringLength(str),
|
||||
OBJECT_TO_JSVAL(win->GetGlobalJSObject()),
|
||||
nsnull, nsnull,
|
||||
JSPROP_READONLY | JSPROP_ENUMERATE);
|
||||
|
||||
sDoSecurityCheckInAddProperty = doSecurityCheckInAddProperty;
|
||||
|
||||
if (!ok) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*objp = obj;
|
||||
|
||||
Reference in New Issue
Block a user