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
|
||||
nsContentUtils::IsCallerXBL()
|
||||
{
|
||||
JSScript *script;
|
||||
JSContext *cx = GetCurrentJSContext();
|
||||
if (!cx)
|
||||
return false;
|
||||
|
||||
// New Hotness.
|
||||
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.
|
||||
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
|
||||
return false;
|
||||
return JS_GetScriptUserBit(script);
|
||||
// For remote XUL, we run XBL in the XUL scope. Given that we care about
|
||||
// compat and not security for remote XUL, just always claim to be XBL.
|
||||
if (!xpc::AllowXBLScope(c)) {
|
||||
MOZ_ASSERT(nsContentUtils::AllowXULXBLForPrincipal(xpc::GetCompartmentPrincipal(c)));
|
||||
return true;
|
||||
}
|
||||
|
||||
return xpc::IsXBLScope(c);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user