Skip to content

Commit

Permalink
start dropping service workers
Browse files Browse the repository at this point in the history
  • Loading branch information
WaylonWalker committed Dec 2, 2023
1 parent 4c8a2be commit 22b2354
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,22 @@
</style>

<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js");
navigator.serviceWorker.addEventListener("controllerchange", () => {
console.log("new worker");
window.location.reload();
});
}
navigator.serviceWorker.getRegistrations().then(function (registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
</script>

<!-- <script> -->
<!-- if ("serviceWorker" in navigator) { -->
<!-- navigator.serviceWorker.register("/service-worker.js"); -->
<!-- navigator.serviceWorker.addEventListener("controllerchange", () => { -->
<!-- console.log("new worker"); -->
<!-- window.location.reload(); -->
<!-- }); -->
<!-- } -->
<!-- </script> -->
</head>

<body>
Expand Down

0 comments on commit 22b2354

Please sign in to comment.