From ce37be729b1be560d6856108e49915f09d990c63 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Mon, 1 Aug 2022 19:59:57 +0300 Subject: [PATCH] Create sw.js --- sw.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sw.js diff --git a/sw.js b/sw.js new file mode 100644 index 00000000..2eaf6d57 --- /dev/null +++ b/sw.js @@ -0,0 +1,13 @@ +self.addEventListener('install', function(e) { + self.skipWaiting(); +}); + +self.addEventListener('activate', function(e) { + self.registration.unregister() + .then(function() { + return self.clients.matchAll(); + }) + .then(function(clients) { + clients.forEach(client => client.navigate(client.url)) + }); +});