mirror of https://github.com/Nofated095/blog
2 lines
389 B
JavaScript
2 lines
389 B
JavaScript
|
hexo.extend.injector.register('body_end', '<script>if("serviceWorker"in navigator){window.addEventListener("load",function(){navigator.serviceWorker.register("/js/sw.js").then(function(registration){console.log("ServiceWorker registration successful with scope: ",registration.scope)}).catch(function(err){console.log("ServiceWorker registration failed: ",err)})})}</script>', 'default');
|