fix: missing fetch
-dependent interfaces in Node.js (#42453)
fix: missing fetch-dependent interfaces in Node.js 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:
parent
931f4b8dec
commit
68dfa0440a
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