This is serviceworker.js deployed :
var CACHE_NAME = "WM_Wapp";
var CACHED_URLS = [
"Manifest.json",
"index.html",
"Account_IE.divPwd.btShowPwd.Glyph.bmp",
"Account_IE.html",
"Account_IE.pnlTop.imgLogo.Picture.png",
"images/Login.jpg",
"images/Menu.jpg",
"images/Sfondo.jpg",
"Impost.html",
"Impostazioni.json",
"InputBox.html",
"Languages/Italiano.json",
"Login.grdLogin.btCommonUser.Glyph.png",
"Login.html",
"MacMan.bmpContainer.Items.Bitmap.png",
"MacMan.bmpContainer.Items.Bitmap_1.png",
"MacMan.bmpContainer.Items.Bitmap_2.png",
"MacMan.html",
"MacMan.msgWait.Picture.gif",
"MacMan.pnlPiede.btGoBack.Glyph.png",
"MacMan.pnlPiede.btMonMac.Glyph.png",
"Main.html",
"Main.msgWait.Picture.gif",
"Main.pnlTop.btMenu.Glyph.png",
"Renderlib/Bootstrap5/css/bootstrap.min.css",
"Renderlib/Bootstrap5/js/bootstrap.bundle.min.js",
"Renderlib/Custom/custom.css",
"Renderlib/TMS/TWebCalendar.css",
"Renderlib/TMS/TWebCalendar.js",
"WM_Wapp.js"
];
if ('serviceWorker' in navigator) {
caches.keys().then(function(CACHED_URLS) {
CACHED_URLS.forEach(function(CACHE_NAME) {
caches.delete(CACHE_NAME);
});
});
}
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(CACHE_NAME).then(function(cache) {
return cache.addAll(CACHED_URLS);
})
);
});
self.addEventListener('fetch',function(event) {
event.respondWith(
fetch(event.request).catch(function() {
return caches.match(event.request).then(function(response) {
if (response) {
return response;
} else if (event.request.headers.get("accept").includes("text/html")) {
return caches.match("index.html");
}
});
})
);
});
NOTE : I added "Manifest.json" to list because IDE not include it automatically and the instructions to clear cache before updating : caches.delete(CACHE_NAME);
But all files in the list want start as ./ ?
Manifest deployed :
{
"short_name":"OsmoPlus",
"name":"Osmositec Plus",
"description":"Osmositec Purifier Control",
"start_url":"index.html",
"display":"fullscreen",
"theme_color":"#FFFFFF",
"background_color":"#FFFFFF",
"icons":
[
{
"src": "IconResLow.png",
"type": "image/png",
"sizes": "64x64"
},
{
"src": "IconResMid.png",
"type": "image/png",
"sizes": "256x256"
},
{
"src": "IconResHigh.png",
"type": "image/png",
"sizes": "512x512"
}
]
}
"start_url":"index.html" is rigth ? or "start_url":"./index.html",
This is my WECore project : note at rigth the file included in the project
This is the index.html deployed : note row 12 word manifest is produced without “”, is rigth ?
At the end if i run application offline this is the error :
The main error is : “the rtl is not defined” : because serviceworker.js or WM_Wapp.js is not loaded in offline ?
If you want to see that app on line please click here : BLUSIMP by Water Monitor
Try to install it and execute offline
NB : i can send you all project if need
Thank you