eastkiki / userAgent

check browser from userAgent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

userAgent

userAgent repository was moved to the ua_parse. move to ua_parse

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
    },
    app: {
        isApp: true | false, // type boolen
        name: "daumapps" | "crios", // type string
        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 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
    },
    app: {
        isApp: true | false, // type boolen
        name: "daumapps" | "crios", // type string
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    }
};

About

check browser from userAgent

License:Other


Languages

Language:JavaScript 100.0%