mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995123 - Associate sandboxPrototyped Sandboxes to their prototype Window, if it exists. r=bz
This commit is contained in:
parent
8f936fb594
commit
55d4fbb621
@ -1397,6 +1397,19 @@ XPCJSRuntime::InterruptCallback(JSContext *cx)
|
|||||||
// running in a non-DOM scope, we have to just let it keep running.
|
// running in a non-DOM scope, we have to just let it keep running.
|
||||||
RootedObject global(cx, JS::CurrentGlobalOrNull(cx));
|
RootedObject global(cx, JS::CurrentGlobalOrNull(cx));
|
||||||
nsRefPtr<nsGlobalWindow> win = WindowOrNull(global);
|
nsRefPtr<nsGlobalWindow> win = WindowOrNull(global);
|
||||||
|
if (!win && IsSandbox(global)) {
|
||||||
|
// If this is a sandbox associated with a DOMWindow via a
|
||||||
|
// sandboxPrototype, use that DOMWindow. This supports GreaseMonkey
|
||||||
|
// and JetPack content scripts.
|
||||||
|
JS::Rooted<JSObject*> proto(cx);
|
||||||
|
if (!JS_GetPrototype(cx, global, &proto))
|
||||||
|
return false;
|
||||||
|
if (proto && IsSandboxPrototypeProxy(proto) &&
|
||||||
|
(proto = js::CheckedUnwrap(proto, /* stopAtOuter = */ false)))
|
||||||
|
{
|
||||||
|
win = WindowGlobalOrNull(proto);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!win)
|
if (!win)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user