JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4258
  • Score
    100M100P100Q111091F

check browser and browser's version from userAgent

Package Exports

  • ua_parser/src/js/userAgent

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ua_parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

userAgent

check browser and browser's version from userAgent

Build Status

usage

browser


var ua = util.userAgent();

ua = {
    ua,
    browser: {
        [msie | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: ["msie" | "safari" | "firefox" | "chrome" | "opera" | "android" | "iphone" | "ipad" | "ipod" | "polaris" | "dolfin" | "unknown"], // type string
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    },
    platform : ["pc" | "tablet" | "mobile"], // type string
    os : {
        ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "unknown"] : true,
        name : ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "unknown"] // type string
    }
};

nodejs

install


npm install ua_parser

var util = require("ua_parser").util;
var ua = util.userAgent(USERAGENT_STRING);

ua = {
    ua,
    browser: {
        [msie | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: ["msie" | "safari" | "firefox" | "chrome" | "opera" | "android" | "iphone" | "ipad" | "ipod" | "polaris" | "dolfin" | "unknown"], // type string
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    },
    platform : ["pc" | "tablet" | "mobile"], // type string
    os : {
        ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "unknown"] : true,
        name : ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "unknown"] // type string
    }
};