Moved serviceworker around

This commit is contained in:
Kasper Rynning-Tønnesen
2016-04-27 00:46:19 +02:00
parent 3a91c50796
commit 173b0920fe
4 changed files with 15 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -54,6 +54,18 @@ var connection_options = {
'force new connection': true
};
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/static/service-worker.js', {scope: '/static/'})
.then(function (registration) {
console.log(registration);
})
.catch(function (e) {
console.error(e);
})
} else {
console.log('Service Worker is not supported in this browser.');
}
$().ready(function(){
if(!window.fromFront && window.location.pathname != "/") init();
});