Register service worker with root scope

This commit is contained in:
William Brawner 2022-02-04 21:09:27 -07:00
parent 3a94e603d3
commit 717ddb3884

View file

@ -1,7 +1,7 @@
let socket: WebSocket | null = null; let socket: WebSocket | null = null;
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/static/js/sw.js') navigator.serviceWorker.register('/static/js/sw.js', { 'scope': '/' })
.then(function (registration) { .then(function (registration) {
console.log('Registration successful, scope is:', registration.scope); console.log('Registration successful, scope is:', registration.scope);
}) })