Detect whether the current page is displayed as a standalone PWA.
Checks the standard display-mode: standalone media query and the iOS Safari
navigator.standalone compatibility signal. This does not prove that the app
is installed, trusted, or controlled by a service worker.
Callers that already own browser references can inject them without changing
globals:
Optional browser environment to inspect instead of globals.
Returns boolean
true in detected standalone presentation; otherwise false.
Remarks
Browser-preferred and safe to call during SSR. This is a one-time
synchronous read and does not install listeners. When environment is
supplied, only those objects are inspected.
Detect whether the current page is displayed as a standalone PWA.
Checks the standard
display-mode: standalonemedia query and the iOS Safarinavigator.standalonecompatibility signal. This does not prove that the app is installed, trusted, or controlled by a service worker.Callers that already own browser references can inject them without changing globals: