From d466d57b95abef6ef11368f5b59a3520cf530479 Mon Sep 17 00:00:00 2001 From: Shyam Seshadri <97863898+shyam-builder@users.noreply.github.com> Date: Mon, 7 Mar 2022 20:36:25 +0530 Subject: [PATCH] fix: remove script length check when initializing service worker (#100) --- src/lib/main/snippet.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/main/snippet.ts b/src/lib/main/snippet.ts index 77e2c5b9..3f2dbac8 100644 --- a/src/lib/main/snippet.ts +++ b/src/lib/main/snippet.ts @@ -34,7 +34,7 @@ export function snippet( if (top != win) { // this is an iframe top!.dispatchEvent(new CustomEvent('pt1', { detail: win })); - } else if (scripts!.length) { + } else { // set a timeout to fire if PT hasn't initialized in Xms timeout = setTimeout(fallback, 10000); doc.addEventListener('pt0', clearFallback); @@ -65,8 +65,6 @@ export function snippet( // no support for atomics or service worker fallback(); } - } else if (debug && scripts!.length === 0) { - console.debug('No Partytown scripts found'); } } else if (debug) { console.warn('Partytown config.lib url must start with "/"');