Sha256: 7b4ad10f463a3547fd3ae705c95eeb66d09a46f16bc1a791793bea9bd4bca7fc
Contents?: true
Size: 903 Bytes
Versions: 26
Compression:
Stored size: 903 Bytes
Contents
<script> if ("serviceWorker" in navigator) { if (navigator.serviceWorker.controller) { console.log("An active service worker found, no need to register"); } else { // Register the service worker navigator.serviceWorker .register("{{ "/sw.js" | prepend: site.baseurl }}", { scope: "{{ "/" | prepend: site.baseurl }}" }) .then(function (reg) { console.log("Service worker has been registered for scope: " + reg.scope); }); } } // 检测浏览器是否支持SW // if(navigator.serviceWorker != null){ // navigator.serviceWorker.register("{{ "/sw.js" | prepend: site.baseurl }}") // .then(function(registartion){ // console.log('支持sw:',registartion.scope) // }) // } else { // console.log('不支持sw') // } </script>
Version data entries
26 entries across 26 versions & 1 rubygems