5c28ddf9b8
让 web 前端可「添加到主屏幕」以独立窗口启动——iOS 上免证书的类原生体验(也使 Android/桌面出现安装提示)。 - site.webmanifest 补全可安装字段:id / start_url / scope / description / orientation;icons 拆出独立 any 与 maskable 条目。 - index.html 加 iOS 独立窗口 meta:apple-mobile-web-app-capable / status-bar-style / title + application-name(旧版 iOS 仍读这些才无 Safari chrome 启动)。 - public/sw.js(新):仅缓存同源静态壳,**绝不拦截 /api/***(SSE /api/hub/events、剪贴板、信令、中继需要实时不缓冲的网络连接,直接放行);跨源(字体/CDN)也放行。导航走 network-first(新部署即取新 HTML),静态资源 stale-while-revalidate。cdrop 离线无意义,故此 SW 只为可安装 + 秒开壳。 - main.tsx:SW 注册仅在浏览器 + prod;dev 下干扰 Vite HMR、桌面壳(Wails WebView,wails:// / loopback origin)SW 行为不可靠,故 isDesktop() 跳过。 - auth.ts:PKCE verifier / state 从 sessionStorage 改 localStorage。iOS 独立 PWA 可能在独立上下文跑完 OIDC 往返、回跳时重启 PWA 而清空 sessionStorage,导致 verifier 丢失登录失败;localStorage 跨上下文存活。verifier 在 callback 即消费并删除、且无配对 code 无用,落盘窗口的安全代价可忽略。
53 lines
3.4 KiB
HTML
53 lines
3.4 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<!-- 站点图标:吉祥物品牌资产(favicon 透明头像 avatar-head + app-icon 金底整身)。
|
|
Google 搜索要求 favicon 为 48px 整数倍,故提供 96/48;16/32 供浏览器标签;
|
|
apple-touch 走 iOS 主屏(金底不透明);manifest 供 PWA 安装。 -->
|
|
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96.png" />
|
|
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48.png" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180.png" />
|
|
<link rel="manifest" href="/site.webmanifest" />
|
|
<meta name="theme-color" content="#E8B923" />
|
|
<!-- PWA / 主屏安装:manifest 的 display:standalone 覆盖新版 iOS,但旧版 iOS
|
|
仍读 apple-* meta 才会以无 Safari chrome 的独立窗口启动。status-bar 用
|
|
default(白底深字,可读),title 决定主屏图标下的名称。 -->
|
|
<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="default" />
|
|
<meta name="apple-mobile-web-app-title" content="CDrop" />
|
|
<meta name="application-name" content="CDrop" />
|
|
<!-- 预取品牌 logo:登录跳转回来后首页 header 立即用到;早取 + 后端一周缓存,
|
|
避免那一刻才发起请求导致的闪烁重载。 -->
|
|
<link rel="preload" as="image" href="/logo-mark.png" />
|
|
|
|
<!-- 远程字体:Orbit Gothic CJK / Maple Mono / Fredoka(品牌字标)/ Noto Serif
|
|
(含 CJK SC/TC/JP/KR)。三个 CDN 各自 host,预连接以并行 TCP/TLS。woff2 由各
|
|
CSS 内的 @font-face 声明拉取。gfonts.commilitia.net 是 Google Fonts 的
|
|
Cloudflare Worker 代理(uri 与 fonts.googleapis.com 一致,仅域名改写);
|
|
Fredoka 与 Noto Serif 子集均经此镜像,与品牌资产 README 指定的字标字体一致。 -->
|
|
<link rel="preconnect" href="https://orbit-gothic.cdn.commilitia.net" crossorigin />
|
|
<link rel="preconnect" href="https://maple-mono.cdn.commilitia.net" crossorigin />
|
|
<link rel="preconnect" href="https://gfonts.commilitia.net" crossorigin />
|
|
<link rel="stylesheet" href="https://orbit-gothic.cdn.commilitia.net/orbit-gothic-face.css" />
|
|
<link rel="stylesheet" href="https://maple-mono.cdn.commilitia.net/maple-mono.css" />
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://gfonts.commilitia.net/css2?family=Fredoka:wght@300..700&family=Noto+Serif+JP:wght@200..900&family=Noto+Serif+KR:wght@200..900&family=Noto+Serif+SC:wght@200..900&family=Noto+Serif+TC:wght@200..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap"
|
|
/>
|
|
|
|
<title>Commilitia Drop</title>
|
|
</head>
|
|
<body>
|
|
<!-- class="juzhen" 启用聚珍作用域:薄壳 scope.include ".juzhen" 仅处理此
|
|
子树,normalize(关原生 text-autospace)亦收敛于此,不外溢到 body 上的
|
|
Mantine portal。 -->
|
|
<div id="root" class="juzhen"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|