ui: add a useless service worker

This commit is contained in:
undefined committed 2022-08-31 12:38:38 +08:00
1 parent 023a13b066
commit ccb380852f
6 files changed
+43 -7

No files matched your search

+10
View File
@@ -27,6 +27,16 @@ console.log(
`,
);
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register(new URL('./service-worker', import.meta.url)).then((registration) => {
console.log('SW registered: ', registration);
}).catch((registrationError) => {
console.log('SW registration failed: ', registrationError);
});
});
}
document.addEventListener('DOMContentLoaded', async () => {
window.UiContext = JSON.parse(window.UiContext);