[Feature] Add PWA support (#157)
* Add icons, manifest * Add workbox config
This commit is contained in:
@@ -58,3 +58,16 @@ window.onload = () => {
|
||||
}).$mount('#app');
|
||||
window.pusher = vuePusher.init();
|
||||
};
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker
|
||||
.register('/sw.js')
|
||||
.then(registration => {
|
||||
console.log('SW registered: ', registration);
|
||||
})
|
||||
.catch(registrationError => {
|
||||
console.log('SW registration failed: ', registrationError);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user