fix: missing fetch
-dependent interfaces in Node.js (#42419)
fix: missing fetch-dependent interfaces in Node.js
This commit is contained in:
parent
ea219dd702
commit
4aa9070e6c
2 changed files with 20 additions and 11 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue