How to use the ua-parser-js.UAParser.BROWSER function in ua-parser-js

To help you get started, we’ve selected a few ua-parser-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / ua-parser-js / ua-parser-js-tests.ts View on Github external
parser.getEngine().name
    parser.getEngine().version

    // OS
    result.os.name
    result.os.version
    parser.getOS().name
    parser.getOS().version

    // CPU
    result.cpu.architecture
    parser.getCPU().architecture

    // Extensions
    var uaString = 'ownbrowser/1.3';
    var ownBrowser = [[/(ownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
    var parser = new UAParser(uaString, { browser: ownBrowser });

}
github DefinitelyTyped / DefinitelyTyped / types / ua-parser-js / ua-parser-js-tests.ts View on Github external
parser.getEngine().name
    parser.getEngine().version

    // OS
    result.os.name
    result.os.version
    parser.getOS().name
    parser.getOS().version

    // CPU
    result.cpu.architecture
    parser.getCPU().architecture

    // Extensions
    var uaString = 'ownbrowser/1.3';
    var ownBrowser = [[/(ownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
    var parser = new UAParser(uaString, { browser: ownBrowser });

}

ua-parser-js

Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment

AGPL-3.0
Latest version published 2 months ago

Package Health Score

97 / 100
Full package analysis