跳转到内容

manifest: id

manifest: idid 成员为 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 同源。

Browser / PlatformSupportSinceConfidenceSourceNotes
Chrome (Desktop)✅ yes96highref
Chrome (Android)✅ yes96highref
Edge (Desktop)✅ yes96highref
Firefox (Desktop)❌ nohighrefNot implemented as of Firefox 128.
Safari (macOS)❌ nohighrefNot implemented as of Safari 17.
Safari (iOS)❌ nohighrefNot implemented as of Safari 17.
Samsung Internet✅ yes17.0mediumref

Source: spec · MDN · Last verified 2026-07-12 · Confidence: medium

← 返回兼容性浏览器。