Work around deprecation of offline capabilities
This commit is contained in:
22
globals.js
22
globals.js
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user