diff --git a/src/Twig/PwaRuntime.php b/src/Twig/PwaRuntime.php index 0792016..dc9d4de 100644 --- a/src/Twig/PwaRuntime.php +++ b/src/Twig/PwaRuntime.php @@ -102,6 +102,7 @@ private function injectServiceWorker(string $output, bool $injectSW, array $swAt if ('serviceWorker' in navigator) { const wb = new Workbox('{$url}'{$registerOptions}); wb.register(); + window.workbox = wb; } SERVICE_WORKER;