mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: missing fetch-dependent interfaces in Node.js (#42419)
fix: missing fetch-dependent interfaces in Node.js
This commit is contained in:
@@ -3,8 +3,11 @@ import { wrapFsWithAsar } from './asar-fs-wrapper';
|
||||
wrapFsWithAsar(require('fs'));
|
||||
|
||||
// See ElectronRendererClient::DidCreateScriptContext.
|
||||
if ((globalThis as any).blinkFetch) {
|
||||
globalThis.fetch = (globalThis as any).blinkFetch;
|
||||
if ((globalThis as any).blinkfetch) {
|
||||
const keys = ['fetch', 'Response', 'FormData', 'Request', 'Headers'];
|
||||
for (const key of keys) {
|
||||
(globalThis as any)[key] = (globalThis as any)[`blink${key}`];
|
||||
}
|
||||
}
|
||||
|
||||
// Hook child_process.fork.
|
||||
|
||||
Reference in New Issue
Block a user