mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
17 lines
493 B
JavaScript
17 lines
493 B
JavaScript
importScripts(
|
|
"https://cdn.jsdelivr.net/gh/golang/go@go1.22.5/misc/wasm/wasm_exec.js",
|
|
"https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js",
|
|
);
|
|
|
|
registerWasmHTTPListener("/app.wasm");
|
|
|
|
// Skip installed stage and jump to activating stage
|
|
self.addEventListener("install", (event) => {
|
|
event.waitUntil(skipWaiting());
|
|
});
|
|
|
|
// Start controlling clients as soon as the SW is activated
|
|
self.addEventListener("activate", (event) => {
|
|
event.waitUntil(clients.claim());
|
|
});
|