Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 3d23631

Browse files
committed
Revert "Place more common consumer Windows OS names before Windows Server names."
This reverts commit ccf08e2. Ref. #112.
1 parent c884d39 commit 3d23631

File tree

2 files changed

+57
-58
lines changed

2 files changed

+57
-58
lines changed

platform.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
'6.4': '10 Technical Preview',
8585
'6.3': '8.1',
8686
'6.2': '8',
87-
'6.1': '7 / Server 2008 R2',
88-
'6.0': 'Vista / Server 2008',
89-
'5.2': 'XP 64-bit / Server 2003',
87+
'6.1': 'Server 2008 R2 / 7',
88+
'6.0': 'Server 2008 / Vista',
89+
'5.2': 'Server 2003 / XP 64-bit',
9090
'5.1': 'XP',
9191
'5.01': '2000 SP1',
9292
'5.0': '2000',
@@ -334,7 +334,7 @@
334334
/** The browser/environment version. */
335335
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
336336

337-
/** A flag to indicate if the OS begins with "Name Version /". */
337+
/** A flag to indicate if the OS ends with "/ Version" */
338338
var isSpecialCasedOS;
339339

340340
/* Detectable layout engines (order is important). */
@@ -950,9 +950,8 @@
950950
}
951951
// Parse the OS into an object.
952952
if (os) {
953-
data =
954-
/ ([\d.+]+)$/.exec(os) ||
955-
(isSpecialCasedOS = /^[a-z]+ ([\d.+]+) \//i.exec(os));
953+
data = / ([\d.+]+)$/.exec(os);
954+
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
956955
os = {
957956
'architecture': 32,
958957
'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
@@ -1080,7 +1079,7 @@
10801079
* The family of the OS.
10811080
*
10821081
* Common values include:
1083-
* "Windows", "Windows 7 / Server 2008 R2", "Windows Vista / Server 2008",
1082+
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
10841083
* "Windows XP", "OS X", "Ubuntu", "Debian", "Fedora", "Red Hat", "SuSE",
10851084
* "Android", "iOS" and "Windows Phone"
10861085
*

test/test.js

+50-50
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@
321321
'version': '0.4'
322322
},
323323

324-
'Arora 0.6 (like Safari 4.x) on Windows Vista / Server 2008': {
324+
'Arora 0.6 (like Safari 4.x) on Windows Server 2008 / Vista': {
325325
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )',
326326
'layout': 'WebKit',
327327
'name': 'Arora',
328-
'os': 'Windows Vista / Server 2008',
328+
'os': 'Windows Server 2008 / Vista',
329329
'version': '0.6'
330330
},
331331

@@ -345,12 +345,12 @@
345345
'version': '0.11.0'
346346
},
347347

348-
'Avant Browser on Windows Vista / Server 2008': {
348+
'Avant Browser on Windows Server 2008 / Vista': {
349349
'ua': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Avant Browser)',
350350
'layout': 'Trident',
351351
'mode': 8,
352352
'name': 'Avant Browser',
353-
'os': 'Windows Vista / Server 2008'
353+
'os': 'Windows Server 2008 / Vista'
354354
},
355355

356356
'Avant Browser (IE 7 mode) on Windows XP': {
@@ -529,11 +529,11 @@
529529
'version': '34.0.1847.137'
530530
},
531531

532-
'Chrome 38.0.2103.0 on Windows 7 / Server 2008 R2 64-bit': {
532+
'Chrome 38.0.2103.0 on Windows Server 2008 R2 / 7 64-bit': {
533533
'ua': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2103.0 Safari/537.36',
534534
'layout': 'Blink',
535535
'name': 'Chrome',
536-
'os': 'Windows 7 / Server 2008 R2 64-bit',
536+
'os': 'Windows Server 2008 R2 / 7 64-bit',
537537
'version': '38.0.2103.0'
538538
},
539539

@@ -751,21 +751,21 @@
751751
'version': '3.7#{alpha}5'
752752
},
753753

754-
'Firefox 4.0#{beta}8 on Windows Vista / Server 2008 64-bit': {
754+
'Firefox 4.0#{beta}8 on Windows Server 2008 / Vista 64-bit': {
755755
'ua': 'Mozilla/5.0 (Windows NT 6.0; Win64; IA64; rv:2.0b8pre) Gecko/20101213 Firefox/4.0b8pre',
756756
'layout': 'Gecko',
757757
'name': 'Firefox',
758-
'os': 'Windows Vista / Server 2008 64-bit',
758+
'os': 'Windows Server 2008 / Vista 64-bit',
759759
'platform': 'Win64',
760760
'prerelease': 'beta',
761761
'version': '4.0#{beta}8'
762762
},
763763

764-
'Firefox 4.0#{beta}8 32-bit on Windows 7 / Server 2008 R2 64-bit': {
764+
'Firefox 4.0#{beta}8 32-bit on Windows Server 2008 R2 / 7 64-bit': {
765765
'ua': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101114 Firefox/4.0b8pre',
766766
'layout': 'Gecko',
767767
'name': 'Firefox',
768-
'os': 'Windows 7 / Server 2008 R2 64-bit',
768+
'os': 'Windows Server 2008 R2 / 7 64-bit',
769769
'platform': 'Win32',
770770
'prerelease': 'beta',
771771
'version': '4.0#{beta}8'
@@ -1115,11 +1115,11 @@
11151115
'version': '6.1'
11161116
},
11171117

1118-
'IE 7.0#{beta} on Windows XP 64-bit / Server 2003': {
1118+
'IE 7.0#{beta} on Windows Server 2003 / XP 64-bit': {
11191119
'ua': 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2)',
11201120
'layout': 'Trident',
11211121
'name': 'IE',
1122-
'os': 'Windows XP 64-bit / Server 2003',
1122+
'os': 'Windows Server 2003 / XP 64-bit',
11231123
'prerelease': 'beta',
11241124
'version': '7.0#{beta}'
11251125
},
@@ -1170,58 +1170,58 @@
11701170
'version': '8.0'
11711171
},
11721172

1173-
'IE 8.0 32-bit on Windows Vista / Server 2008 64-bit': {
1173+
'IE 8.0 32-bit on Windows Server 2008 / Vista 64-bit': {
11741174
'ua': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)',
11751175
'cpuClass': 'x86',
11761176
'layout': 'Trident',
11771177
'mode': 8,
11781178
'name': 'IE',
1179-
'os': 'Windows Vista / Server 2008 64-bit',
1179+
'os': 'Windows Server 2008 / Vista 64-bit',
11801180
'platform': 'Win32',
11811181
'version': '8.0'
11821182
},
11831183

1184-
'IE 8.0 on Windows 7 / Server 2008 R2 64-bit': {
1184+
'IE 8.0 on Windows Server 2008 R2 / 7 64-bit': {
11851185
'ua': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0)',
11861186
'cpuClass': 'x64',
11871187
'layout': 'Trident',
11881188
'mode': 8,
11891189
'name': 'IE',
1190-
'os': 'Windows 7 / Server 2008 R2 64-bit',
1190+
'os': 'Windows Server 2008 R2 / 7 64-bit',
11911191
'platform': 'Win64',
11921192
'version': '8.0'
11931193
},
11941194

1195-
'IE 9.0 (platform preview) on Windows 7 / Server 2008 R2': {
1195+
'IE 9.0 (platform preview) on Windows Server 2008 R2 / 7': {
11961196
'ua': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
11971197
'external': null,
11981198
'layout': 'Trident',
11991199
'mode': 9,
12001200
'name': 'IE',
1201-
'os': 'Windows 7 / Server 2008 R2',
1201+
'os': 'Windows Server 2008 R2 / 7',
12021202
'version': '9.0'
12031203
},
12041204

1205-
'IE 9.0#{beta} (IE 7 mode) on Windows 7 / Server 2008 R2': {
1205+
'IE 9.0#{beta} (IE 7 mode) on Windows Server 2008 R2 / 7': {
12061206
'ua': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
12071207
'appMinorVersion': 'beta',
12081208
'layout': 'Trident',
12091209
'mode': 7,
12101210
'name': 'IE',
1211-
'os': 'Windows 7 / Server 2008 R2',
1211+
'os': 'Windows Server 2008 R2 / 7',
12121212
'prerelease': 'beta',
12131213
'version': '9.0#{beta}'
12141214
},
12151215

1216-
'IE 9.0#{beta} (platform preview; IE 8 mode) on Windows 7 / Server 2008 R2': {
1216+
'IE 9.0#{beta} (platform preview; IE 8 mode) on Windows Server 2008 R2 / 7': {
12171217
'ua': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
12181218
'appMinorVersion': 'beta',
12191219
'cpuClass': 'x86',
12201220
'external': null,
12211221
'layout': 'Trident',
12221222
'mode': 8,
12231223
'name': 'IE',
1224-
'os': 'Windows 7 / Server 2008 R2',
1224+
'os': 'Windows Server 2008 R2 / 7',
12251225
'prerelease': 'beta',
12261226
'version': '9.0#{beta}'
12271227
},
@@ -1246,12 +1246,12 @@
12461246
'version': '9.0'
12471247
},
12481248

1249-
'IE 9.0 on Windows 7 / Server 2008 R2 64-bit': {
1249+
'IE 9.0 on Windows Server 2008 R2 / 7 64-bit': {
12501250
'ua': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; AMD64; Trident/5.0)',
12511251
'layout': 'Trident',
12521252
'mode': 9,
12531253
'name': 'IE',
1254-
'os': 'Windows 7 / Server 2008 R2 64-bit',
1254+
'os': 'Windows Server 2008 R2 / 7 64-bit',
12551255
'version': '9.0'
12561256
},
12571257

@@ -1265,13 +1265,13 @@
12651265
'version': '10.0'
12661266
},
12671267

1268-
'IE 10.0 (platform preview) on Windows Vista / Server 2008': {
1268+
'IE 10.0 (platform preview) on Windows Server 2008 / Vista': {
12691269
'ua': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.0; Trident/6.0)',
12701270
'external': null,
12711271
'layout': 'Trident',
12721272
'mode': 10,
12731273
'name': 'IE',
1274-
'os': 'Windows Vista / Server 2008',
1274+
'os': 'Windows Server 2008 / Vista',
12751275
'version': '10.0'
12761276
},
12771277

@@ -1293,21 +1293,21 @@
12931293
'version': '11.0'
12941294
},
12951295

1296-
'IE 11.0 32-bit (identifying as Firefox 12.0) on Windows 7 / Server 2008 R2 64-bit': {
1296+
'IE 11.0 32-bit (identifying as Firefox 12.0) on Windows Server 2008 R2 / 7 64-bit': {
12971297
'ua': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko/20100101 Firefox/12.0',
12981298
'layout': 'Trident',
12991299
'mode': 11,
13001300
'name': 'IE',
1301-
'os': 'Windows 7 / Server 2008 R2 64-bit',
1301+
'os': 'Windows Server 2008 R2 / 7 64-bit',
13021302
'version': '11.0'
13031303
},
13041304

1305-
'IE 11.0 32-bit (identifying as Firefox 22.0) on Windows 7 / Server 2008 R2 64-bit': {
1305+
'IE 11.0 32-bit (identifying as Firefox 22.0) on Windows Server 2008 R2 / 7 64-bit': {
13061306
'ua': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko/20100101 Firefox/22.0',
13071307
'layout': 'Trident',
13081308
'mode': 11,
13091309
'name': 'IE',
1310-
'os': 'Windows 7 / Server 2008 R2 64-bit',
1310+
'os': 'Windows Server 2008 R2 / 7 64-bit',
13111311
'version': '11.0'
13121312
},
13131313

@@ -1453,11 +1453,11 @@
14531453
'version': '11.0'
14541454
},
14551455

1456-
'SRWare Iron 0.2.152.0 on Windows Vista / Server 2008': {
1456+
'SRWare Iron 0.2.152.0 on Windows Server 2008 / Vista': {
14571457
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Iron/0.2.152.0 Safari/41562480.525',
14581458
'layout': 'WebKit',
14591459
'name': 'SRWare Iron',
1460-
'os': 'Windows Vista / Server 2008',
1460+
'os': 'Windows Server 2008 / Vista',
14611461
'version': '0.2.152.0'
14621462
},
14631463

@@ -1522,40 +1522,40 @@
15221522
'version': '4.7.1'
15231523
},
15241524

1525-
'Lunascape 5.0#{alpha}3 (Trident) on Windows XP 64-bit / Server 2003': {
1525+
'Lunascape 5.0#{alpha}3 (Trident) on Windows Server 2003 / XP 64-bit': {
15261526
'ua': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; Lunascape 5.0 alpha3)',
15271527
'layout': 'Trident',
15281528
'name': 'Lunascape',
1529-
'os': 'Windows XP 64-bit / Server 2003',
1529+
'os': 'Windows Server 2003 / XP 64-bit',
15301530
'prerelease': 'alpha',
15311531
'version': '5.0#{alpha}3'
15321532
},
15331533

1534-
'Lunascape 6.1.7.21880 (Trident) on Windows 7 / Server 2008 R2': {
1534+
'Lunascape 6.1.7.21880 (Trident) on Windows Server 2008 R2 / 7': {
15351535
'ua': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Lunascape 6.1.7.21880)',
15361536
'layout': 'Trident',
15371537
'mode': 8,
15381538
'name': 'Lunascape',
1539-
'os': 'Windows 7 / Server 2008 R2',
1539+
'os': 'Windows Server 2008 R2 / 7',
15401540
'version': '6.1.7.21880'
15411541
},
15421542

1543-
'Lunascape 6.2.1.22445 (Gecko) on Windows Vista / Server 2008': {
1543+
'Lunascape 6.2.1.22445 (Gecko) on Windows Server 2008 / Vista': {
15441544
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.13) Gecko/20100917 Firefox/3.5.13 Lunascape/6.2.1.22445',
15451545
'layout': 'Gecko',
15461546
'name': 'Lunascape',
1547-
'os': 'Windows Vista / Server 2008',
1547+
'os': 'Windows Server 2008 / Vista',
15481548
'version': '6.2.1.22445'
15491549
},
15501550

1551-
'Lunascape 6.3.1.22729#{beta} (Trident) on Windows Vista / Server 2008': {
1551+
'Lunascape 6.3.1.22729#{beta} (Trident) on Windows Server 2008 / Vista': {
15521552
'ua': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; Lunascape/6.3.1.22729)',
15531553
'appMinorVersion': 'beta',
15541554
'external': null,
15551555
'layout': 'Trident',
15561556
'mode': 9,
15571557
'name': 'Lunascape',
1558-
'os': 'Windows Vista / Server 2008',
1558+
'os': 'Windows Server 2008 / Vista',
15591559
'prerelease': 'beta',
15601560
'version': '6.3.1.22729#{beta}'
15611561
},
@@ -2069,11 +2069,11 @@
20692069
'version': '4.0.4'
20702070
},
20712071

2072-
'Safari 5.1 on Windows 7 / Server 2008 R2': {
2072+
'Safari 5.1 on Windows Server 2008 R2 / 7': {
20732073
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50',
20742074
'layout': 'WebKit',
20752075
'name': 'Safari',
2076-
'os': 'Windows 7 / Server 2008 R2',
2076+
'os': 'Windows Server 2008 R2 / 7',
20772077
'version': '5.1'
20782078
},
20792079

@@ -2146,11 +2146,11 @@
21462146
'version': '1.1.13'
21472147
},
21482148

2149-
'SeaMonkey 2.0#{beta}1 on Windows Vista / Server 2008': {
2149+
'SeaMonkey 2.0#{beta}1 on Windows Server 2008 / Vista': {
21502150
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090717 SeaMonkey/2.0b1',
21512151
'layout': 'Gecko',
21522152
'name': 'SeaMonkey',
2153-
'os': 'Windows Vista / Server 2008',
2153+
'os': 'Windows Server 2008 / Vista',
21542154
'prerelease': 'beta',
21552155
'version': '2.0#{beta}1'
21562156
},
@@ -2270,12 +2270,12 @@
22702270
'version': '2.9.2#{beta}'
22712271
},
22722272

2273-
'Sleipnir 2.9.4 (IE 7 mode) on Windows Vista / Server 2008': {
2273+
'Sleipnir 2.9.4 (IE 7 mode) on Windows Server 2008 / Vista': {
22742274
'ua': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; Sleipnir/2.9.4)',
22752275
'layout': 'Trident',
22762276
'mode': 7,
22772277
'name': 'Sleipnir',
2278-
'os': 'Windows Vista / Server 2008',
2278+
'os': 'Windows Server 2008 / Vista',
22792279
'version': '2.9.4'
22802280
},
22812281

@@ -2287,12 +2287,12 @@
22872287
'os': 'Windows XP'
22882288
},
22892289

2290-
'SlimBrowser (IE 5 mode) on Windows 7 / Server 2008 R2': {
2290+
'SlimBrowser (IE 5 mode) on Windows Server 2008 R2 / 7': {
22912291
'ua': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SlimBrowser)',
22922292
'layout': 'Trident',
22932293
'mode': 5,
22942294
'name': 'SlimBrowser',
2295-
'os': 'Windows 7 / Server 2008 R2'
2295+
'os': 'Windows Server 2008 R2 / 7'
22962296
},
22972297

22982298
'Sunrise 1.7.5 on OS X 10.5.5': {
@@ -2502,7 +2502,7 @@
25022502

25032503
QUnit.test('parses IE identifying as Firefox 12.0', function(assert) {
25042504
var actual = parse('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko/20100101 Firefox/12.0'),
2505-
expected = 'IE 11.0 32-bit (identifying as Firefox 12.0) on Windows 7 / Server 2008 R2 64-bit';
2505+
expected = 'IE 11.0 32-bit (identifying as Firefox 12.0) on Windows Server 2008 R2 / 7 64-bit';
25062506

25072507
assert.strictEqual(actual.description, expected);
25082508
});
@@ -2579,7 +2579,7 @@
25792579

25802580
QUnit.test('parses Windows 7 OS', function(assert) {
25812581
var actual = parse('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36'),
2582-
expected = 'Windows 7 / Server 2008 R2';
2582+
expected = 'Windows Server 2008 R2 / 7';
25832583

25842584
assert.strictEqual(actual.os.family, expected);
25852585
assert.strictEqual(actual.os.version, '7');

0 commit comments

Comments
 (0)