Windows 11系统Chrome浏览器中navigator.getInstalledRelatedApps()返回空数组问题排查
Let's break down your issue, answer your key question, and confirm the solution you discovered:
Is .well-known/assetlinks.json required for getInstalledRelatedApps()?
Short answer: No, not for web-only apps. That file exists primarily to link native mobile apps (like Android APKs) to web apps for cross-app permissions or deep linking. For standalone web apps, the critical configuration that enables this API is in your Web App Manifest's related_applications field.
Why your API call was returning an empty array
The root problem was a misconfiguration in your Manifest's related_applications section. You originally set the url field to point directly to your Manifest file ("/_new/manifest.json"), but the web app spec requires this value to be the root path of your web app (like "/") instead of the specific Manifest URL.
Original (broken) configuration:
"related_applications": [ { "id": "https://www.swisswebcams.ch/", "platform": "webapp", "url": "/_new/manifest.json" } ]
Fixed configuration:
"related_applications": [ { "id": "https://www.swisswebcams.ch/", "platform": "webapp", "url": "/" } ]
How to verify the fix
- Confirm your web app is properly installed via Chrome (check your Windows 11 Start Menu or Chrome's "Installed apps" list)
- Run this code in the browser console to validate:
if('getInstalledRelatedApps' in navigator) { navigator.getInstalledRelatedApps().then(apps => console.warn(apps)); }
After updating the Manifest, you'll see your installed web app appear in the returned array.
Quick checks to avoid future issues
- Your Chrome version (146.0.7680.178) fully supports the
getInstalledRelatedApps()API - Your site runs over HTTPS (a hard requirement for this API to function)
- Ensure the
idin your Manifest matches theidinrelated_applications(your setup here is valid, since"/"resolves to the full site URL)
内容的提问来源于stack exchange,提问作者Simon Ferndriger




