mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834701 - Stop depending on the XBL bit in IsCallerXBL. r=bz
This commit is contained in:
parent
ba4133d1ab
commit
a457b1a245
@ -1725,20 +1725,20 @@ nsContentUtils::IsCallerChrome()
|
|||||||
bool
|
bool
|
||||||
nsContentUtils::IsCallerXBL()
|
nsContentUtils::IsCallerXBL()
|
||||||
{
|
{
|
||||||
JSScript *script;
|
|
||||||
JSContext *cx = GetCurrentJSContext();
|
JSContext *cx = GetCurrentJSContext();
|
||||||
if (!cx)
|
if (!cx)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// New Hotness.
|
|
||||||
JSCompartment *c = js::GetContextCompartment(cx);
|
JSCompartment *c = js::GetContextCompartment(cx);
|
||||||
if (xpc::AllowXBLScope(c))
|
|
||||||
return xpc::IsXBLScope(c);
|
|
||||||
|
|
||||||
// XBL scopes are behind a pref, so check the XBL bit as well.
|
// For remote XUL, we run XBL in the XUL scope. Given that we care about
|
||||||
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
|
// compat and not security for remote XUL, just always claim to be XBL.
|
||||||
return false;
|
if (!xpc::AllowXBLScope(c)) {
|
||||||
return JS_GetScriptUserBit(script);
|
MOZ_ASSERT(nsContentUtils::AllowXULXBLForPrincipal(xpc::GetCompartmentPrincipal(c)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return xpc::IsXBLScope(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user