fex-team / ua-device

userAgent解析库
http://fex-team.github.io/ua-device/
BSD 3-Clause "New" or "Revised" License
1.45k stars 173 forks source link

是否可以识别出百度框的版本 #28

Closed xuexb closed 7 years ago

xuexb commented 7 years ago

输入:

var input = 'Mozilla/5.0 (Linux; Android 5.1; Coolpad 8722V Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1916.138 Mobile Safari/537.36 T7/7.4 baiduboxapp/8.1 (Baidu; P1 5.1)';

输出:

{
    "options": {
        "useFeatures": false,
        "detectCamouflage": true
    },
    "browser": {
        "stock": false,
        "hidden": false,
        "channel": "Nightly",
        "name": "百度框",
        "version": {
            "original": "35.0.1916.138"
        }
    },
    "engine": {
        "name": "Webkit",
        "version": {
            "original": "537.36",
            "alias": null
        }
    },
    "os": {
        "name": "Android",
        "version": {
            "alias": "5.1",
            "original": "5.1"
        }
    },
    "device": {
        "type": "mobile",
        "identified": false,
        "model": "8722",
        "manufacturer": "Coolpad"
    },
    "camouflage": false,
    "features": []
}

是否可以输出手百8.1版本号呢

xuexb commented 7 years ago

还有一些自带的浏览器, 如:

Mozilla/5.0 (Linux; Android 5.1.1; vivo X7Plus Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.0.0 Mobile Safari/537.36 VivoBrowser/5.1.6

是否可以识别出 \s+(\w+Browser)\/([\d\.]+) 这样的呢? 那会不会存在啥问题

kevindu1993 commented 7 years ago

您好,问题已收录,7月16号前统一处理,至于你说的这2个都是可以的

kevindu1993 commented 7 years ago

已发0.1.10版本