Index: src/inspector/injected-script.cc |
diff --git a/src/inspector/injected-script.cc b/src/inspector/injected-script.cc |
index 8e7ca6be3b55677d104221cd20014d94f4f7c569..d966d60bc6c1acb3590e3750fe8b7981f62ef9e9 100644 |
--- a/src/inspector/injected-script.cc |
+++ b/src/inspector/injected-script.cc |
@@ -99,10 +99,16 @@ std::unique_ptr<InjectedScript> InjectedScript::create( |
v8::Number::New(isolate, inspectedContext->contextId())}; |
v8::MicrotasksScope microtasksScope(isolate, |
v8::MicrotasksScope::kDoNotRunMicrotasks); |
+ |
+ int contextGroupId = inspectedContext->contextGroupId(); |
+ int contextId = inspectedContext->contextId(); |
+ V8InspectorImpl* inspector = inspectedContext->inspector(); |
v8::Local<v8::Value> injectedScriptValue; |
if (!function->Call(context, windowGlobal, arraysize(info), info) |
.ToLocal(&injectedScriptValue)) |
return nullptr; |
+ if (inspector->getContext(contextGroupId, contextId) != inspectedContext) |
+ return nullptr; |
if (!injectedScriptValue->IsObject()) return nullptr; |
return wrapUnique(new InjectedScript(inspectedContext, |
injectedScriptValue.As<v8::Object>(), |