You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
527 B
20 lines
527 B
2 years ago
|
window.addEventListener('load', function (e) {
|
||
|
if (navigator.serviceWorker) {
|
||
|
navigator.serviceWorker.ready.then(function (reg) {
|
||
|
reg.active.postMessage({
|
||
|
type: 'swVersionRequest',
|
||
|
})
|
||
|
})
|
||
|
navigator.serviceWorker.addEventListener('message', function (e) {
|
||
|
if ('type' in e.data) {
|
||
|
switch (e.data.type) {
|
||
|
case 'swVersion': {
|
||
|
document.getElementById('sw-version-div').classList.remove('hidden')
|
||
|
document.getElementById('sw-version').textContent = e.data.version
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
})
|