Fix #660 - Infer device vendor & type from sec-ch-ua-model

This commit is contained in:
Faisal Salman
2024-11-30 18:55:27 +07:00
parent 48c221b50b
commit aed89f0b41
3 changed files with 197 additions and 7 deletions

View File

@@ -1200,11 +1200,16 @@
}
if (uaCH[MODEL]) {
this.set(MODEL, uaCH[MODEL]);
}
// Xbox-Specific Detection
if (uaCH[MODEL] == 'Xbox') {
this.set(TYPE, CONSOLE)
.set(VENDOR, MICROSOFT);
if (!this.get(TYPE) || !this.get(VENDOR)) {
var reParse = {};
rgxMapper.call(reParse, 'droid 9; ' + uaCH[MODEL] + ')', rgxMap);
if (!this.get(TYPE) && !!reParse.type) {
this.set(TYPE, reParse.type);
}
if (!this.get(VENDOR) && !!reParse.vendor) {
this.set(VENDOR, reParse.vendor);
}
}
}
if (uaCH[FORMFACTORS]) {
var ff;