Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 395ec20

Browse files
author
Frances Coronel
committed
Service worker added back
Signed-off-by: Frances Coronel <[email protected]>
1 parent 1d6eead commit 395ec20

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
// if ('serviceWorker' in navigator) {
3-
// window.addEventListener('load', () => {
4-
// navigator.serviceWorker.register('/sw.js').then(registration => {
5-
// console.info('The service worker was registered! 🎉', registration);
6-
// }).catch(registrationError => {
7-
// console.error('The service worker registration failed. 😭️', registrationError);
8-
// });
9-
// });
10-
// }
2+
if ('serviceWorker' in navigator) {
3+
window.addEventListener('load', () => {
4+
navigator.serviceWorker.register('/sw.js').then(registration => {
5+
console.info('The service worker was registered! 🎉', registration);
6+
}).catch(registrationError => {
7+
console.error('The service worker registration failed. 😭️', registrationError);
8+
});
9+
});
10+
}
1111

1212
</script>

0 commit comments

Comments
 (0)