Add PWA install support for mobile and desktop
Register service worker, install prompt UI, iOS meta tags, and document install steps in DEPLOY.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -104,6 +104,8 @@ const PUBLIC_PATHS = new Set([
|
||||
function isPublicPath(reqPath) {
|
||||
if (PUBLIC_PATHS.has(reqPath)) return true
|
||||
if (reqPath.startsWith('/assets/')) return true
|
||||
if (reqPath === '/sw.js' || reqPath.endsWith('.webmanifest')) return true
|
||||
if (/^\/workbox-[\w-]+\.js$/.test(reqPath)) return true
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#0f3460" />
|
||||
<meta name="apple-mobile-web-app-title" content="道德经" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||
|
||||
Reference in New Issue
Block a user