mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add a useless service worker
This commit is contained in:
1 parent
023a13b066
commit
ccb380852f
6 files changed
+43
-7
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user