Skip to content

Commit bb30af9

Browse files
committed
Set skipExisting to true, linting
1 parent c569a4e commit bb30af9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pywb/static/loadWabac.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ class WabacReplay
1111
}
1212

1313
async init() {
14-
const scope = '/';
14+
const scope = "/";
1515

16-
await navigator.serviceWorker.register("/static/sw.js?" + new URLSearchParams(this.queryParams).toString(), {scope});
16+
await navigator.serviceWorker.register(
17+
"/static/sw.js?" + new URLSearchParams(this.queryParams).toString(),
18+
{ scope },
19+
);
1720

1821
let initedResolve = null;
1922

@@ -36,7 +39,7 @@ class WabacReplay
3639
name: this.collName,
3740
type: "live",
3841
file: {"sourceUrl": `proxy:${proxyPrefix}`},
39-
skipExisting: false,
42+
skipExisting: true,
4043
extraConfig: {
4144
prefix: proxyPrefix,
4245
isLive: false,
@@ -56,9 +59,9 @@ class WabacReplay
5659
navigator.serviceWorker.controller.postMessage(msg);
5760
}
5861

59-
window.addEventListener('message', event => {
62+
window.addEventListener("message", event => {
6063
let data = event.data;
61-
if (data.wb_type !== 'load') return;
64+
if (data.wb_type !== "load") return;
6265
history.replaceState({}, data.title, this.prefix + data.ts + '/' + data.url);
6366
window.WBBanner.onMessage(event);
6467
});

0 commit comments

Comments
 (0)