Currently Chromium is falsely detected as Chrome because navigator.userAgent doesn't distinguish itself enough from Chrome.
Chromium userAgent:
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
DeviceDetector.parse(navigator.userAgent) result:
{
"client": {
"type": "browser",
"name": "Chrome",
"version": "134.0",
"engine": "Blink",
"engineVersion": ""
},
"os": {
"name": "GNU/Linux",
"version": "",
"platform": "x64"
},
"device": {
"type": "desktop",
"brand": "",
"model": ""
},
"bot": null
}
Note that client.name is Chrome in the parse result above.
If we look at navigator.userAgentData.brands we see that this is actually Chromium:
[
{
"brand": "Not:A-Brand",
"version": "24"
},
{
"brand": "Chromium",
"version": "134"
}
]
Consider providing alternate methods to parse (or optional arguments) on DeviceDetector that accept additional arguments such as userAgentData (from navigator.userAgentData) and/or plugins (from navigator.plugins) to give more accurate results.
Currently Chromium is falsely detected as Chrome because
navigator.userAgentdoesn't distinguish itself enough from Chrome.Chromium userAgent:
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"DeviceDetector.parse(navigator.userAgent) result:
{ "client": { "type": "browser", "name": "Chrome", "version": "134.0", "engine": "Blink", "engineVersion": "" }, "os": { "name": "GNU/Linux", "version": "", "platform": "x64" }, "device": { "type": "desktop", "brand": "", "model": "" }, "bot": null }Note that
client.nameisChromein the parse result above.If we look at
navigator.userAgentData.brandswe see that this is actually Chromium:[ { "brand": "Not:A-Brand", "version": "24" }, { "brand": "Chromium", "version": "134" } ]Consider providing alternate methods to
parse(or optional arguments) onDeviceDetectorthat accept additional arguments such asuserAgentData(fromnavigator.userAgentData) and/orplugins(fromnavigator.plugins) to give more accurate results.