mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Re-added serviceworker, hopefully it works
This commit is contained in:
@@ -60,13 +60,25 @@ var connection_options = {
|
||||
var fromFront = false;
|
||||
var fromChannel = false;
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
if (navigator.serviceWorker) {
|
||||
navigator.serviceWorker.register('/service-worker.js', {scope: '/'})
|
||||
.then(function (registration) {
|
||||
console.log(registration);
|
||||
})
|
||||
.catch(function (e) {
|
||||
console.error(e);
|
||||
});
|
||||
} else {
|
||||
console.log('Service Worker is not supported in this browser.');
|
||||
}
|
||||
|
||||
/*if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.getRegistration().then(function(r) {
|
||||
try {
|
||||
r.unregister();
|
||||
} catch(e) {}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
$().ready(function(){
|
||||
|
||||
Reference in New Issue
Block a user