diff --git a/shell/renderer/api/electron_api_context_bridge.cc b/shell/renderer/api/electron_api_context_bridge.cc index 3aa96a80c6724..9154800654efe 100644 --- a/shell/renderer/api/electron_api_context_bridge.cc +++ b/shell/renderer/api/electron_api_context_bridge.cc @@ -575,7 +575,7 @@ void ExposeAPIInWorld(v8::Isolate* isolate, CHECK(frame); v8::Local target_context = - world_id == 0 ? frame->MainWorldScriptContext() + world_id == WorldIDs::MAIN_WORLD_ID ? frame->MainWorldScriptContext() : frame->GetScriptContextFromWorldId(isolate, world_id); gin_helper::Dictionary global(target_context->GetIsolate(),