From bf13ec22854a2a65b238d4bf13e5722a17341c6f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 10 Mar 2020 14:46:18 +0000 Subject: [PATCH] Claim clients to avoid the refresh --- src/vector/dendrite-sw.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vector/dendrite-sw.js b/src/vector/dendrite-sw.js index 1d4d0b5b..1ded2b1c 100644 --- a/src/vector/dendrite-sw.js +++ b/src/vector/dendrite-sw.js @@ -47,6 +47,9 @@ self.addEventListener('activate', function(event) { const go = new Go() WebAssembly.instantiateStreaming(fetch(`${bundle_path}/../../dendrite.wasm`), go.importObject).then((result) => { go.run(result.instance) + // make fetch calls go through this sw - notably if a page registers a sw, it does NOT go through any sw by default + // unless you refresh or call this function. + self.clients.claim() }); }) )