@3cr/viewer-browser 0.0.152 → 0.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/playground/index.html +1 -3
- package/playground/sw.js +3 -2
package/package.json
CHANGED
package/playground/index.html
CHANGED
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
<script src="https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@{{version}}/dist/Viewer3CR.umd.js"> </script>
|
|
9
9
|
<script type="module">
|
|
10
10
|
function invokeServiceWorkerUpdateFlow(registration) {
|
|
11
|
-
|
|
12
|
-
// let waiting Service Worker know it should became active
|
|
11
|
+
console.log('[SW] Found update, pushing')
|
|
13
12
|
registration.waiting.postMessage('SKIP_WAITING')
|
|
14
|
-
}
|
|
15
13
|
}
|
|
16
14
|
function initServiceWorker() {
|
|
17
15
|
// Only enable service worker in production
|
package/playground/sw.js
CHANGED
|
@@ -8,9 +8,9 @@ self.addEventListener("activate", async () => {
|
|
|
8
8
|
});
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
self.addEventListener("message", (event) => {
|
|
11
|
+
self.addEventListener("message", async (event) => {
|
|
12
12
|
if (event.data === "SKIP_WAITING") {
|
|
13
|
-
self.skipWaiting()
|
|
13
|
+
await self.skipWaiting();
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
self.addEventListener("fetch", (event) => {
|
|
@@ -37,3 +37,4 @@ async function handleServerRequest(request) {
|
|
|
37
37
|
cache.put(request, networkResponse.clone());
|
|
38
38
|
return networkResponse; // Return the fetched response
|
|
39
39
|
}
|
|
40
|
+
async function abc() {}
|