Detect whether the current browser document provides the minimum
JavaScript-detectable prerequisites for PWA functionality.
This function checks for a secure context, Service Worker API support,
and, by default, a web app manifest link with a non-empty href. Options
can make the manifest optional or require the current path to be within a
same-origin scope.
It does not validate or request the manifest, verify service worker
registration, determine whether the app is installed, or guarantee that an
installation prompt is available. Browser-specific installation policies
may impose additional requirements.
Detect whether the current browser document provides the minimum JavaScript-detectable prerequisites for PWA functionality.
This function checks for a secure context, Service Worker API support, and, by default, a web app manifest link with a non-empty
href. Options can make the manifest optional or require the current path to be within a same-origin scope.It does not validate or request the manifest, verify service worker registration, determine whether the app is installed, or guarantee that an installation prompt is available. Browser-specific installation policies may impose additional requirements.
Usage:
Output: