Skip to content

Commit

Permalink
chore: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Sep 26, 2024
1 parent 4e1fd90 commit 3a14def
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/domains/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3a14def

Please sign in to comment.