The display-mode
CSS media feature can be used to test whether a web app is being displayed in a normal browser tab or in some alternative way, such as a standalone app or fullscreen mode.
For example:
-
A progressive web app can set its display mode by setting the
display
member in its manifest. In this case, the value ofdisplay-mode
identifies the value that was set (but note that this may not be the same as the value requested in the manifest, since a browser may not support the requested mode). -
Any web app can use the Fullscreen API or the Document Picture-in-Picture API to set the display mode, and in this case the value of
display-mode
identifies the mode that was set.
The display-mode
value applies to the top-level browsing context and any child browsing contexts.