Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/http.ts>UserAgentInfo

A JavaScript extension package for building strong and modern applications.
Latest
interface UserAgentInfo
import { type UserAgentInfo } from "https://deno.land/x/ayonli_jsext@v0.9.72/http.ts";

Represents the user agent information.

Most browsers use the User-Agent or the navigator.userAgent string to indicate what they are compatible instead of what they are made of. This interface tries to represent the actual user agent information as accurate as possible.

Properties

name: string

The name of the user agent, e.g. Chrome, Firefox, Safari, Edge, etc.

optional
version: string | undefined

The version of the user agent, e.g. 127.0.0.0. This value can be undefined if the version is not provided.

optional
runtime: Pick<RuntimeInfo, "identity" | "version"> | undefined

JavaScript runtime information defined by the user agent, only available if the user agent is a browser or a JavaScript server runtime.

platform: WellknownPlatform | "unknown"

The platform on which the user agent is running, e.g. darwin, windows, linux, android, etc.

mobile: boolean

Whether the user agent is running on a mobile device, includes tablets.

optional
raw: string

The original user agent string passed into parseUserAgent.