diff options
Diffstat (limited to 'vendor/twbs/bootstrap/site/sw.js')
-rw-r--r-- | vendor/twbs/bootstrap/site/sw.js | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/vendor/twbs/bootstrap/site/sw.js b/vendor/twbs/bootstrap/site/sw.js index bc67fee25..db9229cf0 100644 --- a/vendor/twbs/bootstrap/site/sw.js +++ b/vendor/twbs/bootstrap/site/sw.js @@ -1,5 +1,27 @@ -/* global workbox:false */ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ -self.importScripts('docs/4.1/assets/js/vendor/{fileName}') +(function () { + 'use strict' -workbox.precaching.precacheAndRoute([]) + 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) + } + }) + }) + } + }) + }) + } +}()) |