From 3e8b049d680b90bc102bb6e8a3538444a8e48371 Mon Sep 17 00:00:00 2001 From: Slawek Kolodziej Date: Wed, 6 Sep 2023 17:20:38 +0200 Subject: [PATCH] fix: exit early when both atomics and ServiceWorker are not supported (#237) --- src/integration/snippet.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/integration/snippet.ts b/src/integration/snippet.ts index 46647845..842f9226 100644 --- a/src/integration/snippet.ts +++ b/src/integration/snippet.ts @@ -15,6 +15,7 @@ export const createSnippet = (config: PartytownConfig | undefined | null, snippe return [ `!(function(w,p,f,c){`, + `if(!window.crossOriginIsolated && !navigator.serviceWorker) return;`, Object.keys(filteredConfig).length > 0 ? `c=w[p]=Object.assign(w[p]||{},${configStr});` : `c=w[p]=w[p]||{};`,