// Source - https://stackoverflow.com/a
// Posted by João Pimentel Ferreira, modified by community. See post 'Timeline' for change history
// Retrieved 2025-11-25, License - CC BY-SA 4.0
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./serviceWorker.js')
.then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
}