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

Commit d6e64f1

Browse files
committed
Rename "Microsoft Edge" to "Edge", and fix Xbox OS detection.
1 parent 98c4e06 commit d6e64f1

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

platform.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@
357357
'Avant Browser',
358358
'Breach',
359359
'Camino',
360+
'Edge',
360361
'Electron',
361362
'Epiphany',
362363
'Fennec',
@@ -369,7 +370,6 @@
369370
'Konqueror',
370371
'Lunascape',
371372
'Maxthon',
372-
{ 'label': 'Microsoft Edge', 'pattern': 'Edge' },
373373
'Midori',
374374
'Nook Browser',
375375
'PaleMoon',
@@ -823,7 +823,9 @@
823823
}
824824
// Detect Xbox 360 and Xbox One.
825825
else if (/\bXbox\b/i.test(product)) {
826-
os = null;
826+
if (product == 'Xbox 360') {
827+
os = null;
828+
}
827829
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
828830
description.unshift('mobile mode');
829831
}
@@ -1033,7 +1035,7 @@
10331035
* The name of the browser's layout engine.
10341036
*
10351037
* The list of common layout engines include:
1036-
* "Blink", "Edge", "Gecko", "Trident" and "WebKit"
1038+
* "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
10371039
*
10381040
* @memberOf platform
10391041
* @type string|null
@@ -1057,9 +1059,8 @@
10571059
* The name of the browser/environment.
10581060
*
10591061
* The list of common browser names include:
1060-
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
1061-
* "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
1062-
* "Opera Mini" and "Opera"
1062+
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", "Edge",
1063+
* "PhantomJS", "Safari", "SeaMonkey", "Silk", "Opera Mini" and "Opera"
10631064
*
10641065
* Mobile versions of some browsers have "Mobile" appended to their name:
10651066
* eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"

test/test.js

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,12 +1267,13 @@
12671267
'version': '9.0'
12681268
},
12691269

1270-
'IE 10.0 on Microsoft Xbox One': {
1270+
'IE 10.0 on Microsoft Xbox One (Windows 8)': {
12711271
'ua': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Xbox; Xbox One)',
12721272
'layout': 'Trident',
12731273
'manufacturer': 'Microsoft',
12741274
'mode': 10,
12751275
'name': 'IE',
1276+
'os': 'Windows 8',
12761277
'product': 'Xbox One',
12771278
'version': '10.0'
12781279
},
@@ -1636,32 +1637,52 @@
16361637
'version': '3.x#{alpha}'
16371638
},
16381639

1639-
'Microsoft Edge 12.0 32-bit on Windows 10 Technical Preview 64-bit': {
1640+
'Edge 12.0 32-bit on Windows 10 Technical Preview 64-bit': {
16401641
'ua': 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0',
16411642
'layout': 'EdgeHTML',
1642-
'name': 'Microsoft Edge',
1643+
'name': 'Edge',
16431644
'os': 'Windows 10 Technical Preview 64-bit',
16441645
'version': '12.0'
16451646
},
16461647

1647-
'Microsoft Edge 12.10136 on Windows 10': {
1648+
'Edge 12.10136 on Windows 10': {
16481649
'ua': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136',
16491650
'layout': 'EdgeHTML',
1650-
'name': 'Microsoft Edge',
1651+
'name': 'Edge',
16511652
'os': 'Windows 10',
16521653
'version': '12.10136'
16531654
},
16541655

1655-
'Microsoft Edge 12.0 on Nokia id313 (Windows Phone 10.0)': {
1656+
'Edge 12.0 on Nokia id313 (Windows Phone 10.0)': {
16561657
'ua': 'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Nokia; id313) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0',
16571658
'layout': 'EdgeHTML',
16581659
'manufacturer': 'Nokia',
1659-
'name': 'Microsoft Edge',
1660+
'name': 'Edge',
16601661
'os': 'Windows Phone 10.0',
16611662
'product': 'Nokia id313',
16621663
'version': '12.0'
16631664
},
16641665

1666+
'Edge 13.10553 on Microsoft Xbox One (Windows 10 64-bit)': {
1667+
'ua': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10553',
1668+
'layout': 'EdgeHTML',
1669+
'manufacturer': 'Microsoft',
1670+
'name': 'Edge',
1671+
'os': 'Windows 10 64-bit',
1672+
'product': 'Xbox One',
1673+
'version': '13.10553'
1674+
},
1675+
1676+
'Edge 13.10586 on Microsoft Lumia 950 (Windows Phone 10.0)': {
1677+
'ua': 'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586',
1678+
'layout': 'EdgeHTML',
1679+
'manufacturer': 'Microsoft',
1680+
'name': 'Edge',
1681+
'os': 'Windows Phone 10.0',
1682+
'product': 'Lumia 950',
1683+
'version': '13.10586'
1684+
},
1685+
16651686
'Midori (like Safari 3.x) on Linux 64-bit': {
16661687
'ua': 'Mozilla/5.0 (X11; U; Linux x86_64; ru-ru) AppleWebKit/525.1+ (KHTML, like Gecko, Safari/525.1+) midori',
16671688
'layout': 'WebKit',

0 commit comments

Comments
 (0)