manifest: id
manifest: id — id 成员为 PWA 指定唯一且稳定的身份标识符。
在 id 出现之前,浏览器使用 start_url 来识别已安装的应用——这意味着更改
start_url 可能导致浏览器将该应用视为全新、不同的安装。
id 成员将身份标识与启动 URL 解耦。
{ "name": "My PWA", "id": "/my-app", "start_url": "/my-app/home", "display": "standalone"}如果省略 id,浏览器将默认使用处理后的 start_url(在 id 处理过程中会去除片段标识符,
但保留查询字符串)。显式设置的 id 必须与 start_url 同源。
浏览器与生态支持
Section titled “浏览器与生态支持”| Browser / Platform | Support | Since | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | ✅ yes | 96 | high | ref | — |
| Chrome (Android) | ✅ yes | 96 | high | ref | — |
| Edge (Desktop) | ✅ yes | 96 | high | ref | — |
| Firefox (Desktop) | ❌ no | — | high | ref | Not implemented as of Firefox 128. |
| Safari (macOS) | ❌ no | — | high | ref | Not implemented as of Safari 17. |
| Safari (iOS) | ❌ no | — | high | ref | Not implemented as of Safari 17. |
| Samsung Internet | ✅ yes | 17.0 | medium | ref | — |
← 返回兼容性浏览器。