fix: EventSource undefined in Renderer/Worker (#44475)

This commit is contained in:
Shelley Vohr 2024-10-31 20:24:44 +01:00 committed by GitHub
parent 8be4ae4bab
commit 15151c6853
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 52 additions and 6 deletions

View file

@ -118,8 +118,8 @@ void ElectronRendererClient::DidCreateScriptContext(
v8::Isolate* isolate = env->isolate();
v8::Local<v8::Object> global = renderer_context->Global();
std::vector<std::string> keys = {"fetch", "Response", "FormData", "Request",
"Headers"};
std::vector<std::string> keys = {"fetch", "Response", "FormData",
"Request", "Headers", "EventSource"};
for (const auto& key : keys) {
v8::MaybeLocal<v8::Value> value =
global->Get(renderer_context, gin::StringToV8(isolate, key));