Skip to content

Commit

Permalink
Update ua-parser.js (#696)
Browse files Browse the repository at this point in the history
Fixed Xbox Detection for Chrome-Based Edge
  • Loading branch information
Beat-YT authored Jan 24, 2024
1 parent 9c5d6ee commit 54c633a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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;
Expand Down

0 comments on commit 54c633a

Please sign in to comment.