From 3a14def87ee8aed645566d05ce67dc3bfebcc4e5 Mon Sep 17 00:00:00 2001 From: redhoodsu Date: Thu, 26 Sep 2024 15:36:14 +0800 Subject: [PATCH] chore: small changes --- src/domains/Network.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/domains/Network.ts b/src/domains/Network.ts index 8ef42d1..d382d2a 100644 --- a/src/domains/Network.ts +++ b/src/domains/Network.ts @@ -141,10 +141,15 @@ function enableFetch() { let isFetchSupported = false if (window.fetch) { isFetchSupported = isNative(window.fetch) - } - // #2 Probably not a fetch polyfill - if (!isFetchSupported && navigator.serviceWorker) { - isFetchSupported = true + // #2 Probably not a fetch polyfill + if (!isFetchSupported) { + if (navigator.serviceWorker) { + isFetchSupported = true + } + if (window.Request && isNative(window.Request)) { + isFetchSupported = true + } + } } if (!isFetchSupported) return