1.2.9 • Published 4 years ago

ua_parser v1.2.9

Weekly downloads
1,939
License
MIT
Repository
github
Last release
4 years ago

ua_parser

check browser and browser's version from userAgent

Build Status

NPM Stats

usage

browser

var ua = daumtools.userAgent(); // or window.ua_result

// result
{
    ua,
    browser: {
        [msie | edge | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: "msie" | "edge" | "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" | "chrome" | "unknown"] : true,
        name : "windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown" // type string
    },
    app: {
        isApp: true | false, // type boolen
        name: "fxios" | "crios", // type string, fxios is firefox of iOS, crios is chrome of iOS.
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    }
}

nodejs

install

npm install ua_parser
var result = require("ua_parser").userAgent(USERAGENT_STRING);

// result
{
    ua,
    browser: {
        [msie | edge | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: "msie" | "edge" | "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" | "chrome" | "unknown"] : true,
        name : "windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown" // type string
    },
    app: {
        isApp: true | false, // type boolen
        name: "fxios" | "crios", // type string, fxios is firefox of iOS, crios is chrome of iOS.
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    }
}

NPM

1.2.9

4 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

7 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.19

10 years ago

1.0.18

10 years ago

1.0.17

10 years ago

1.0.16

10 years ago

1.0.15

10 years ago

1.0.14

12 years ago

1.0.7

13 years ago

1.0.5

13 years ago

1.0.1

13 years ago

1.0.0

13 years ago