Work around deprecation of offline capabilities

This commit is contained in:
Joe Tretter
2020-08-29 14:11:41 -05:00
parent e1a15e7efb
commit 32122b8213
2 changed files with 195 additions and 188 deletions

View File

@@ -59,16 +59,20 @@ function initSession(){
// Check if a new cache is available on page load. || TODO: the Server could notify for new versions, then the check would be done closer to time.
window.addEventListener('load', function(e) {
window.applicationCache.addEventListener('updateready', function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
// Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway...
if (confirm('A new version of this site is available. Load it?')) {
window.location.reload();
try{
window.applicationCache.addEventListener('updateready', function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
// Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway...
if (confirm('A new version of this site is available. Load it?')) {
window.location.reload();
}
} else {
// Manifest didn't changed. Nothing new to server.
}
} else {
// Manifest didn't changed. Nothing new to server.
}
}, false);
}, false);
} catch (ex) {
console.log("Quick Fix - switch off AppCachea",ex);
}
}, false);
var indexHtmlRevision = $("#lbRevision").text().split(" ")[1];