We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c95fdc commit a1b9776Copy full SHA for a1b9776
public/sw.js
@@ -0,0 +1,16 @@
1
+// cleanup old Gatsby ServiceWorkers
2
+// https://github.com/NekR/self-destroying-sw
3
+self.addEventListener('install', function (e) {
4
+ self.skipWaiting();
5
+});
6
+
7
+self.addEventListener('activate', function (e) {
8
+ self.registration
9
+ .unregister()
10
+ .then(function () {
11
+ return self.clients.matchAll();
12
+ })
13
+ .then(function (clients) {
14
+ clients.forEach((client) => client.navigate(client.url));
15
+ });
16
0 commit comments