mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-16 13:33:10 +02:00
13 lines
333 B
TypeScript
13 lines
333 B
TypeScript
import { lang } from '@/config';
|
|
|
|
export async function initializeSw() {
|
|
if (!('serviceWorker' in navigator)) return;
|
|
|
|
navigator.serviceWorker.register(`/sw.js`, { scope: '/', type: 'classic' });
|
|
navigator.serviceWorker.ready.then(registration => {
|
|
registration.active?.postMessage({
|
|
msg: 'initialize',
|
|
lang,
|
|
});
|
|
});
|
|
}
|