Files
sonr/internal/vfs/sw.js
T

18 lines
559 B
JavaScript
Raw Normal View History

2024-09-07 18:12:58 -04:00
importScripts(
2024-09-18 02:22:17 -04:00
"https://cdn.jsdelivr.net/gh/golang/go@go1.22.5/misc/wasm/wasm_exec.js",
2024-09-07 18:12:58 -04:00
"https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js",
2024-09-18 02:22:17 -04:00
"https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js",
2024-09-07 18:12:58 -04:00
);
2024-09-18 02:22:17 -04:00
registerWasmHTTPListener("app.wasm");
// Skip installed stage and jump to activating stage
addEventListener("install", (event) => {
event.waitUntil(skipWaiting());
});
// Start controlling clients as soon as the SW is activated
addEventListener("activate", (event) => {
event.waitUntil(clients.claim());
});