website/islands/RegisterServiceWorker.tsx

8 lines
174 B
TypeScript

export default function RegisterServiceWorker({ href }: { href: string }) {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(href)
}
return <></>
}