feat: add pwa manifest and service worker
Wire up a production service worker and web app manifest with install metadata and icon assets. Bump project version to 2.1.0 and register the worker from the main page for offline-ready behavior. Made-with: Cursor
This commit is contained in:
@@ -19,11 +19,14 @@ import App from "../components/App";
|
||||
<meta name="theme-color" content="#1a1a1a">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/icon-192.png">
|
||||
<link rel="icon" type="image/png" sizes="512x512" href="/icon-512.png">
|
||||
<link rel="apple-touch-icon" href="/icon-192.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -34,5 +37,14 @@ import App from "../components/App";
|
||||
-->
|
||||
<App client:only="preact" slot="app-content" />
|
||||
</BscScoreApp>
|
||||
<script>
|
||||
if (typeof window !== 'undefined' && 'serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js').catch((error) => {
|
||||
console.error('Service worker registration failed:', error);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user