The `application-context` CSS media feature provides a reliable, stable, boolean signal indicating what app context the current document window is running in. It evaluates to `true` when the document is in an application context (a top-level browsing context with a manifest applied, presented in its own app window) and `false` in all other contexts (running in a browser tab). This feature separates the concept of "running as an installed app" from the app's current display mode, solving a long-standing gap in the web platform where developers lacked a clean, stable signal for installation state.
Web developers currently lack a reliable way to determine whether their app is running in an installed app window versus a browser tab. Existing signals like the `display-mode` media query reflect presentation mode rather than application context and break under common scenarios (entering fullscreen), leading to incorrect UI behavior such as install prompts reappearing or app-specific UI disappearing. The web platform today has no stable, declarative primitive to distinguish these orthogonal concepts, forcing developers to rely on fragile workarounds. The proposed `application-context` media feature addresses this gap by providing a consistent signal of the current application context, enabling developers to correctly adapt UI and behavior across both installed and browser experiences.