faisalman / ua-parser-js

"Unmask Your Traffic" - UAParser.js: The Essential Web Development Tool for User-Agent Detection
https://uaparser.dev/
GNU Affero General Public License v3.0
9.29k stars 1.2k forks source link

Support Hbbtv devices #610

Closed garritfra closed 1 year ago

garritfra commented 2 years ago

Fixes: #607 Supersedes: #609 Relates to: https://github.com/garritfra/ua-parser-js/pull/8

Adds support for HbbTv information. Since I didn't receive any feedback on #607, I implemented the proposed solution. I'm happy to make adjustments if needed.

Here's a simple example:

    var parser = new UAParser();
    console.log(parser.getResult());

    var uastring = "Opera/9.80 (Linux mips; U; HbbTV/1.1.1 (;Sony; KDL32CX525; PKG4.027EUA; 2011;);; en) Presto/2.7.61 Version/11.00";
    parser.setUA(uastring);
    var result = parser.getResult();

    console.log(result.hbbtv);
    /*
            {
                version: "1.1.1",
                capabilities: "",
                "vendor": "Sony",
                "model": "KDL32CX525",
                "software": "PKG4.027EUA",
                "hardware": "2011"
            },
    */
garritfra commented 1 year ago

Superseded by #618.