Files
sonr/pkg/nebula/assets/js/sw.js
T

23 lines
636 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-22 01:26:15 -04:00
registerWasmHTTPListener("/app.wasm");
2024-09-18 02:22:17 -04:00
// Skip installed stage and jump to activating stage
2024-09-21 21:42:51 -04:00
self.addEventListener("install", (event) => {
2024-09-18 02:22:17 -04:00
event.waitUntil(skipWaiting());
});
// Start controlling clients as soon as the SW is activated
2024-09-21 21:42:51 -04:00
self.addEventListener("activate", (event) => {
2024-09-18 02:22:17 -04:00
event.waitUntil(clients.claim());
});
2024-10-07 16:30:54 -04:00
self.addEventListener("canmakepayment", function (e) {
e.respondWith(new Promise(function (resolve, reject) {
resolve(true);
}));
});