|
|
|
@ -66,15 +66,17 @@
|
|
|
|
|
<script src="assets/js/main.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
// Register a service worker hosted at the root of the
|
|
|
|
|
// site using the default scope.
|
|
|
|
|
navigator.serviceWorker.register('sw.js').then(function (registration) {
|
|
|
|
|
console.log('Service worker registration succeeded:', registration);
|
|
|
|
|
}, /*catch*/ function (error) {
|
|
|
|
|
console.log('Service worker registration failed:', error);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Service workers are not supported.');
|
|
|
|
|
if (platform_type != "cordova" && platform_type != "nw") {
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
// Register a service worker hosted at the root of the
|
|
|
|
|
// site using the default scope.
|
|
|
|
|
navigator.serviceWorker.register('sw.js').then(function (registration) {
|
|
|
|
|
console.log('Service worker registration succeeded:', registration);
|
|
|
|
|
}, /*catch*/ function (error) {
|
|
|
|
|
console.log('Service worker registration failed:', error);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Service workers are not supported.');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|