json-map/js/main.js
2026-01-14 12:58:15 +01:00

13 lines
376 B
JavaScript

window.onload = () => {
'use strict';
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js', {
scope: '/map/'
}).then(function (reg) { // registration worked
console.log('Registration succeeded. Scope is ' + reg.scope);
}).catch(function (error) { // registration failed
console.log('Registration failed with ' + error);
});
};
}