delay SW and passive event listeners

This commit is contained in:
Felix Schulze 2019-11-04 23:27:32 +01:00
parent 9978b379c2
commit 23d653aa94
3 changed files with 9 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -23,5 +23,10 @@ function partB(){
$('select').material_select(); $('select').material_select();
}); });
} }
if('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
</script> </script>
"; ";

View File

@ -140,8 +140,9 @@ När jag började informera mig om Universiteter, antagningspoäng och meritvär
<script src="assets/js/softscrollscript.js"></script> <script src="assets/js/softscrollscript.js"></script>
<script> <script>
if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
navigator.serviceWorker window.addEventListener('load', function() {
.register('/sw.js'); navigator.serviceWorker.register('/sw.js');
});
} }
</script> </script>
</body> </body>