Re: [w3c/manifest] Way to detect if a web app is installed (Issue #1092)

benfrancis left a comment (w3c/manifest#1092)

@dmurph What exactly was the agreement made at TPAC yesterday? It's a bit tricky to tell from these notes. (Apologies I couldn't make it to the meeting due to timezone differences).

> - installed: yes
>   - so this should NOT be true if you are installed but in a browser tab

So:
- An app can have been installed by the user agent but the "installed" media query returns "no" because the current browsing context is a browser tab
- If an app is installed with the "browser" display mode in its manifest, the "installed" media query will always return "no"

I think this is extremely confusing.

> - agree? 
>   - only standardize installed media query, installed: yes or no

Where "installed" means what?

---

## Counter-proposal

- **`navigator.installed`** - Whether the current document falls within the scope of an app installed by the user agent (regardless of the current browsing context or display mode)
  - `true` -  The current document falls within the scope of an app which was installed by the user agent.
  - `false` - The current document does not fall within the scope of an app which was installed by the user agent.
- **`display-mode`** CSS query - The current display mode of the browsing context currently displaying the document (regardless of whether the app is installed)
  - `browser` - The current document is being displayed in a browsing context or an application context with the "browser" display mode (i.e. a browser tab).
  - `minimal-ui` - The current document is being displayed in an application context with the `minimal-ui` display mode.
  - `standalone` - The current document is being displayed in an application context with the `standalone` display mode.
  - `fullscreen` - The current document is being displayed in an application context with the `fullscreen` display mode, or a browsing context using the full screen API.
-  **`navigator.standalone`** - Deprecated because it is confusingly named and only implemented by one vendor

Notes:
- The display mode is about presentation, so makes sense as a media query
- The installed state is about an internal state in the user agent (and/or OS) and has nothing to do with presentation so makes more sense as a DOM property (or method) on the navigator object than a CSS media query about the current document
- The value returned by the `display-mode` media query may be different to the display mode requested in a manifest, either because the user agent has fallen back to a display mode that it supports (as per the specification), or because the navigation that loaded the document was not captured by an application context
- `navigator.installed` may be true even if the `display-mode` media query returns `browser`, either because the manifest requested the browser display mode or because the navigation that loaded the document was not captured by an application context
- `navigator.installed` can be used as a hint to the web app to know whether to prompt the user to install the app
- The `display-mode` media query can be used as a hint to the web app to know what navigation controls it needs to provide itself

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/1092#issuecomment-3521846911
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/manifest/issues/1092/3521846911@github.com>

Received on Wednesday, 12 November 2025 13:07:14 UTC