You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ozgurkon-2020-site/static/service-worker.js

21 lines
885 B

"use strict";
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function (registrations) {
if (!registrations.length) {
console.log('No serviceWorker registrations found.')
return
}
for (let registration of registrations) {
registration.unregister().then(function (boolean) {
console.log(
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' +
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') +
(registration.waiting ? ' .waiting.scriptURL = ' + registration.waiting.scriptURL + '\n' : '') +
(registration.active ? ' .active.scriptURL = ' + registration.active.scriptURL + '\n' : '') +
' .scope: ' + registration.scope + '\n'
)
})
}
});
}