mazey
    Preparing search index...

    Function isDesktop

    • Check whether a user agent represents a desktop or laptop-class device.

      The classifier recognizes Windows, ordinary macOS, Linux, and ChromeOS. Touch capability does not make a Windows device a tablet. A current browser with the existing MacIntel multi-touch iPadOS compatibility signals is excluded from desktop classification.

      Parameters

      • OptionaluserAgent: string

        Optional user-agent string. Defaults to the current browser's guarded navigator signals. An explicit string is classified by itself without current platform or touch information.

      Returns boolean

      true for a recognized desktop or laptop-class device; otherwise false. Returns false during SSR when no explicit user agent is available.

      If an explicitly supplied user agent is not a string.

      Device classification is heuristic and spoofable. Do not use this helper as a security boundary or as a substitute for responsive CSS or feature detection. It does not inspect viewport dimensions.