mazey
    Preparing search index...

    Function isSafePWAEnv

    • 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:

      import { isSafePWAEnv } from "mazey";

      const ret = isSafePWAEnv();
      console.log(ret);

      Output:

      true
      

      Parameters

      Returns boolean

      Whether the detectable minimum PWA prerequisites are satisfied.

      Browser-preferred and safe to call during SSR.