angular-docs-cn/packages/service-worker/safety-worker.js

21 lines
519 B
JavaScript
Raw Normal View History

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
self.addEventListener('install', event => {
self.skipWaiting();
});
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim());
self.registration.unregister().then(() => {
console.log('NGSW Safety Worker - unregistered old service worker');
});
});