Skip to content

Commit d5ccf50

Browse files
committed
Update Os
1 parent b8694e0 commit d5ccf50

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

  • src/Analyser/Header/Useragent

src/Analyser/Header/Useragent/Os.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class Os {
152152

153153
/* Mac OS */
154154

155-
if (/\(Macintosh;/u.test(ua) && !/OS X/u.test(ua)) {
155+
if (/(; |\()Macintosh;/u.test(ua) && !/OS X/u.test(ua)) {
156156
this.data.os.name = 'Mac OS';
157157
this.data.device.type = Constants.deviceType.DESKTOP;
158158
}
@@ -1365,7 +1365,7 @@ class Os {
13651365
this.data.device.type = Constants.deviceType.MOBILE;
13661366
}
13671367

1368-
if (/Series[ ]?60/u.test(ua) || /S60[V\/;]/u.test(ua)) {
1368+
if (/Series[ ]?60/u.test(ua) || /S60[V\/;]/u.test(ua) || /S60 Symb/u.test(ua)) {
13691369
this.data.os.name = 'Series60';
13701370
this.data.os.family = new Family({name: 'Symbian'});
13711371
this.data.device.type = Constants.deviceType.MOBILE;
@@ -1396,6 +1396,7 @@ class Os {
13961396

13971397
if (/Symbian/u.test(ua)) {
13981398
this.data.os.family = new Family({name: 'Symbian'});
1399+
this.data.device.type = Constants.deviceType.MOBILE;
13991400

14001401
if ((match = /SymbianOS\/([0-9.]*)/u.exec(ua))) {
14011402
this.data.os.family.version = new Version({value: match[1]});
@@ -2115,15 +2116,6 @@ class Os {
21152116
this.data.device.type = Constants.deviceType.DESKTOP;
21162117
}
21172118

2118-
if (/elementary OS/u.test(ua)) {
2119-
this.data.os.name = 'elementary OS';
2120-
if ((match = /elementary OS ([A-Za-z]+)/u.exec(ua))) {
2121-
this.data.os.version = new Version({alias: match[1]});
2122-
}
2123-
2124-
this.data.device.type = Constants.deviceType.DESKTOP;
2125-
}
2126-
21272119
if (/Fedora/u.test(ua)) {
21282120
this.data.os.name = 'Fedora';
21292121
if ((match = /Fedora\/[0-9.\-]+fc([0-9]+)/u.exec(ua))) {
@@ -2296,6 +2288,15 @@ class Os {
22962288
}
22972289
}
22982290

2291+
if (/elementary OS/u.test(ua)) {
2292+
this.data.os.name = 'elementary OS';
2293+
if ((match = /elementary OS ([A-Za-z]+)/u.exec(ua))) {
2294+
this.data.os.version = new Version({alias: match[1]});
2295+
}
2296+
2297+
this.data.device.type = Constants.deviceType.DESKTOP;
2298+
}
2299+
22992300
if (/\(Ubuntu; (Mobile|Tablet)/u.test(ua)) {
23002301
this.data.os.name = 'Ubuntu Touch';
23012302

0 commit comments

Comments
 (0)