c2370a1be6
* chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
18 lines
448 B
TypeScript
18 lines
448 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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,
|
|
});
|
|
});
|
|
}
|