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:
@@ -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>
|
||||||
|
|||||||
7
worklenz-frontend/public/unregister-sw.js
Normal file
7
worklenz-frontend/public/unregister-sw.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||||
|
for(let registration of registrations) {
|
||||||
|
registration.unregister();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user