-
Notifications
You must be signed in to change notification settings - Fork 0
/
IndexController.js
28 lines (25 loc) · 910 Bytes
/
IndexController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('service-worker.js').then(function (registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function (err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
//(function () {
// 'use strict';
// // TODO add service worker code here
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker
// .register('serviceworker.js')
// .then(function () {
// console.log('Service Worker Registered');
// });
// }
//})();
//if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('serviceworker.js');
//}