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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-10-31 17:16:36 -05:00 committed by GitHub
parent 532e5cc1f6
commit 03acaade4e
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));

View file

@ -71,8 +71,8 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
// is loaded. See corresponding change in node/init.ts.
v8::Local<v8::Object> global = worker_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(worker_context, gin::StringToV8(isolate, key.c_str()));