摘要
staging(ratewise-staging.zeabur.app)的 manifest.webmanifest 之 scope 與 start_url 為硬編的正式站絕對 URL(https://app.haotool.org/ratewise/),對 staging 網域而言是跨網域,導致 staging PWA 安裝行為異常(安裝入口指向正式站、manifest 與頁面 origin 不一致)。
背景/證據
- 使用者於 staging PWA 實機回報 manifest 指向跨網域 URL。
- 取證(2026-07-06):
curl https://ratewise-staging.zeabur.app/ratewise/manifest.webmanifest 回傳 "scope": "https://app.haotool.org/ratewise/", "start_url": "https://app.haotool.org/ratewise/"。
- 來源:
apps/ratewise/scripts/generate-manifest.mjs L40-44 以 APP_INFO.siteUrl(SSOT,正式站 URL)產生絕對 scope/start_url;註解明載為刻意設計(避免獨立 PWA partition + Chrome HTTPS-First 以 http 語意解析)。
<link rel="manifest"> href 本身走 __BASE_PATH__ 佔位符(相對於部署 base),無硬編問題;問題僅在 manifest 內容。
影響
- staging 環境無法以 staging origin 完成 PWA 安裝驗證;QA 在 staging 裝出來的 PWA 實際指向正式站。
- 正式站行為不受影響。
範圍
驗收標準
摘要
staging(
ratewise-staging.zeabur.app)的manifest.webmanifest之scope與start_url為硬編的正式站絕對 URL(https://app.haotool.org/ratewise/),對 staging 網域而言是跨網域,導致 staging PWA 安裝行為異常(安裝入口指向正式站、manifest 與頁面 origin 不一致)。背景/證據
curl https://ratewise-staging.zeabur.app/ratewise/manifest.webmanifest回傳"scope": "https://app.haotool.org/ratewise/", "start_url": "https://app.haotool.org/ratewise/"。apps/ratewise/scripts/generate-manifest.mjsL40-44 以APP_INFO.siteUrl(SSOT,正式站 URL)產生絕對scope/start_url;註解明載為刻意設計(避免獨立 PWA partition + Chrome HTTPS-First 以 http 語意解析)。<link rel="manifest">href 本身走__BASE_PATH__佔位符(相對於部署 base),無硬編問題;問題僅在 manifest 內容。影響
範圍
apps/ratewise/scripts/generate-manifest.mjs(scope/start_url 生成)apps/ratewise/src/config/app-info.ts(siteUrl SSOT)generate:deterministic與verify:artifactsSSOT 守門;改為部署環境感知需連動生成鏈與驗證腳本,故不在 safe-area hotfix([bug] PWA standalone 內容頁返回列被狀態列遮蔽(sticky 未吃 safe-area-inset-top) #600)內硬修。驗收標準
scope/start_url與部署 origin 同源(相對路徑或依部署環境注入)scope/start_url(保留原設計意圖)verify:artifacts與 manifest 相關測試全綠,PWA 安裝於兩環境皆驗證通過