diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 16d87f98cca..ae932a9d73e 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -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); }