Improved support for Progressive Web Apps (PWA)

- modify webmanifest to use LNBITS_SITE_TITLE and LNBITS_CUSTOM_LOGO env vars
- modify webmanifest to have a more accurate description, start_url and set theme_color to match default lnbits theme
- add service worker to cache requests (chrome requires a registered service worker to activate some pwa functionality)
- move webmanifest to <head> (chrome acts weird with it in the body)
This commit is contained in:
Lee Salminen
2022-07-04 11:01:08 -06:00
parent e4f16f172c
commit d0ba5c6f30
4 changed files with 91 additions and 8 deletions
+7
View File
@@ -702,3 +702,10 @@ new Vue({
)
}
})
if (navigator.serviceWorker != null) {
navigator.serviceWorker.register('/service-worker.js')
.then(function(registration) {
console.log('Registered events at scope: ', registration.scope);
});
}