mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-25 05:29:07 +01:00
3e7d64ac4b
Co-authored-by: Tamania <tamaina@hotmail.co.jp>
14 lines
335 B
TypeScript
14 lines
335 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,
|
|
});
|
|
});
|
|
}
|