perf: optimize app startup and background lifecycles
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
* for non-Electron test environments.
|
||||
*/
|
||||
|
||||
import { net } from 'electron';
|
||||
|
||||
export async function proxyAwareFetch(
|
||||
input: string | URL,
|
||||
init?: RequestInit
|
||||
): Promise<Response> {
|
||||
if (process.versions.electron) {
|
||||
try {
|
||||
const { net } = await import('electron');
|
||||
return await net.fetch(input, init);
|
||||
} catch {
|
||||
// Fall through to the global fetch.
|
||||
|
||||
Reference in New Issue
Block a user