Update ua-parser.js (#696)

Fixed Xbox Detection for Chrome-Based Edge
This commit is contained in:
Beat YT 2024-01-23 21:24:38 -05:00 committed by GitHub
parent 9c5d6ee70e
commit 54c633aac5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1083,6 +1083,11 @@
if (uaCH[MODEL]) {
this.set(MODEL, uaCH[MODEL]);
}
// Xbox-Specific Detection
if (uaCH[MODEL] == 'Xbox') {
this.set(TYPE, CONSOLE);
this.set(VENDOR, MICROSOFT);
}
if (uaCH[FORMFACTOR]) {
var ff;
if (typeof uaCH[FORMFACTOR] !== 'string') {
@ -1104,6 +1109,11 @@
this.set(NAME, osName)
.set(VERSION, osVersion);
}
// Xbox-Specific Detection
if (this.get(NAME) == WINDOWS && uaCH[MODEL] == 'Xbox') {
this.set(NAME, 'Xbox')
this.set(VERSION, undefined)
}
break;
case UA_RESULT:
var data = this.data;