feat(service-worker): add unregister script and update index.html

- Introduced a new script to unregister service workers, enhancing control over service worker lifecycle.
- Updated index.html to include the unregister script, ensuring it is loaded for proper service worker management.
This commit is contained in:
chamikaJ
2025-05-14 16:31:17 +05:30
parent faa5d26601
commit fe2518d53c
2 changed files with 9 additions and 0 deletions

View File

@@ -14,6 +14,8 @@
<title>Worklenz</title> <title>Worklenz</title>
<!-- Environment configuration --> <!-- Environment configuration -->
<script src="/env-config.js"></script> <script src="/env-config.js"></script>
<!-- Unregister service worker -->
<script src="/unregister-sw.js"></script>
</head> </head>
<body> <body>

View File

@@ -0,0 +1,7 @@
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for(let registration of registrations) {
registration.unregister();
}
});
}