silverstripe-progressivewebapp/resources/js/progressivewebapp.js
2018-07-04 12:53:26 +02:00

9 lines
295 B
JavaScript

if ('serviceWorker' in navigator) {
var baseHref = (document.getElementsByTagName('base')[0] || {}).href;
if(baseHref){
navigator.serviceWorker.register(baseHref + 'service-worker.js').then(function() {
//console.log('Service Worker Registered');
});
}
}