diff options
| author | XhmikosR <[email protected]> | 2018-10-15 15:10:40 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2018-10-20 16:00:28 +0300 |
| commit | d08607c08057e7763a1f24c5cad0ca498fc48412 (patch) | |
| tree | b6ea9130a5e40cfff247a3219954d3b04674fa72 | |
| parent | 5bf37eba532aae1ec9decdc81b7ae6bb8b7e37a4 (diff) | |
| download | bootstrap-d08607c08057e7763a1f24c5cad0ca498fc48412.tar.xz bootstrap-d08607c08057e7763a1f24c5cad0ca498fc48412.zip | |
Unregister Service Worker.
| -rw-r--r-- | site/sw.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/site/sw.js b/site/sw.js new file mode 100644 index 000000000..db9229cf0 --- /dev/null +++ b/site/sw.js @@ -0,0 +1,27 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +(function () { + 'use strict' + + if ('serviceWorker' in navigator) { + window.addEventListener('load', function () { + navigator.serviceWorker.getRegistrations().then(function (registrations) { + for (var registration of registrations) { + registration.unregister() + .then(function () { + return self.clients.matchAll() + }) + .then(function (clients) { + clients.forEach(function (client) { + if (client.url && 'navigate' in client) { + client.navigate(client.url) + } + }) + }) + } + }) + }) + } +}()) |
