[Feature] Add PWA support (#157)

* Add icons, manifest

* Add workbox config
This commit is contained in:
Pranav Raj S
2019-10-18 12:37:09 +05:30
committed by GitHub
parent 701722983b
commit af20e61604
33 changed files with 222 additions and 1 deletions

View File

@@ -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);
});
});
}