mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: nodeIntegrationInWorker not working in AudioWorklet
This commit is contained in:
@@ -207,9 +207,16 @@ void ElectronRendererClient::WorkerScriptReadyForEvaluationOnWorkerThread(
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kNodeIntegrationInWorker)) {
|
||||
auto* current = WebWorkerObserver::GetCurrent();
|
||||
if (current)
|
||||
return;
|
||||
WebWorkerObserver::Create()->WorkerScriptReadyForEvaluation(context);
|
||||
if (current) {
|
||||
// With thread pooling, threads can be reused. Check if this context
|
||||
// already has a Node.js environment before skipping.
|
||||
if (node::Environment::GetCurrent(context))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!current)
|
||||
current = WebWorkerObserver::Create();
|
||||
current->WorkerScriptReadyForEvaluation(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user