Comparing version 1.3.3 to 1.3.4
{ | ||
"name": "platform", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "A platform detection library that works on nearly all JavaScript platforms.", | ||
@@ -20,6 +20,6 @@ "license": "MIT", | ||
"devDependencies": { | ||
"docdown": "~0.7.1", | ||
"docdown": "~0.7.2", | ||
"qunit-extras": "^1.5.0", | ||
"qunitjs": "~1.22.0", | ||
"requirejs": "^2.3.2" | ||
"qunitjs": "^1.23.1", | ||
"requirejs": "^2.3.3" | ||
}, | ||
@@ -26,0 +26,0 @@ "files": [ |
@@ -360,2 +360,3 @@ /*! | ||
'Camino', | ||
'Electron', | ||
'Epiphany', | ||
@@ -380,2 +381,3 @@ 'Fennec', | ||
'RockMelt', | ||
{ 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' }, | ||
'SeaMonkey', | ||
@@ -388,2 +390,3 @@ { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, | ||
'Swiftfox', | ||
'Waterfox', | ||
'WebPositive', | ||
@@ -411,2 +414,7 @@ 'Opera Mini', | ||
{ 'label': 'Galaxy S4', 'pattern': 'GT-I9500' }, | ||
{ 'label': 'Galaxy S5', 'pattern': 'SM-G900' }, | ||
{ 'label': 'Galaxy S6', 'pattern': 'SM-G920' }, | ||
{ 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' }, | ||
{ 'label': 'Galaxy S7', 'pattern': 'SM-G930' }, | ||
{ 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' }, | ||
'Google TV', | ||
@@ -422,5 +430,4 @@ 'Lumia', | ||
'PlayBook', | ||
'PlayStation 3', | ||
'PlayStation 4', | ||
'PlayStation Vita', | ||
'PlayStation', | ||
'TouchPad', | ||
@@ -452,3 +459,3 @@ 'Transformer', | ||
'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 }, | ||
'Sony': { 'PlayStation 4': 1, 'PlayStation 3': 1, 'PlayStation Vita': 1 } | ||
'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 } | ||
}); | ||
@@ -480,2 +487,3 @@ | ||
'Tablet OS', | ||
'Tizen', | ||
'Linux', | ||
@@ -570,2 +578,3 @@ 'Mac OS X', | ||
RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || | ||
RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || | ||
RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) | ||
@@ -690,6 +699,10 @@ )) { | ||
} | ||
// Add Chrome version to description for Electron. | ||
else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) { | ||
description.push('Chromium ' + data); | ||
} | ||
// Detect non-Opera (Presto-based) versions (order is important). | ||
if (!version) { | ||
version = getVersion([ | ||
'(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|Silk(?!/[\\d.]+$))', | ||
'(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))', | ||
'Version', | ||
@@ -723,3 +736,3 @@ qualify(name), | ||
} | ||
// Detect IE 11. | ||
// Detect IE 11 identifying as other browsers. | ||
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) { | ||
@@ -758,6 +771,19 @@ if (name) { | ||
) { | ||
name = 'Node.js'; | ||
arch = data.arch; | ||
os = data.platform; | ||
version = /[\d.]+/.exec(data.version)[0]; | ||
if (typeof data.versions == 'object') { | ||
if (typeof data.versions.electron == 'string') { | ||
description.push('Node ' + data.versions.node); | ||
name = 'Electron'; | ||
version = data.versions.electron; | ||
} else if (typeof data.versions.nw == 'string') { | ||
description.push('Chromium ' + version, 'Node ' + data.versions.node); | ||
name = 'NW.js'; | ||
version = data.versions.nw; | ||
} | ||
} else { | ||
name = 'Node.js'; | ||
arch = data.arch; | ||
os = data.platform; | ||
version = /[\d.]+/.exec(data.version) | ||
version = version ? version[0] : 'unknown'; | ||
} | ||
} | ||
@@ -790,2 +816,10 @@ else if (rhino) { | ||
} | ||
// Detect IE 11 masking as other browsers. | ||
else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) { | ||
description.push('masking as ' + name + ' ' + version); | ||
name = 'IE'; | ||
version = '11.0'; | ||
layout = ['Trident']; | ||
os = 'Windows'; | ||
} | ||
os = os && format(os); | ||
@@ -813,3 +847,5 @@ } | ||
else if (/\bXbox\b/i.test(product)) { | ||
os = null; | ||
if (product == 'Xbox 360') { | ||
os = null; | ||
} | ||
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) { | ||
@@ -825,4 +861,10 @@ description.unshift('mobile mode'); | ||
// Detect IE platform preview. | ||
else if (name == 'IE' && useFeatures && context.external === null) { | ||
description.unshift('platform preview'); | ||
else if (name == 'IE' && useFeatures) { | ||
try { | ||
if (context.external === null) { | ||
description.unshift('platform preview'); | ||
} | ||
} catch(e) { | ||
description.unshift('embedded'); | ||
} | ||
} | ||
@@ -949,3 +991,3 @@ // Detect BlackBerry OS version. | ||
name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || | ||
/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) { | ||
/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(name) && layout[1])) { | ||
// Don't add layout details to description if they are falsey. | ||
@@ -1024,2 +1066,5 @@ (data = layout[layout.length - 1]) && description.push(data); | ||
* | ||
* The list of common layout engines include: | ||
* "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit" | ||
* | ||
* @memberOf platform | ||
@@ -1033,2 +1078,7 @@ * @type string|null | ||
* | ||
* The list of manufacturers include: | ||
* "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry", | ||
* "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo", | ||
* "Nokia", "Samsung" and "Sony" | ||
* | ||
* @memberOf platform | ||
@@ -1042,2 +1092,10 @@ * @type string|null | ||
* | ||
* The list of common browser names include: | ||
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", | ||
* "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk", | ||
* "Opera Mini" and "Opera" | ||
* | ||
* Mobile versions of some browsers have "Mobile" appended to their name: | ||
* eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile" | ||
* | ||
* @memberOf platform | ||
@@ -1059,2 +1117,7 @@ * @type string|null | ||
* | ||
* The list of common products include: | ||
* | ||
* "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle", | ||
* "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer" | ||
* | ||
* @memberOf platform | ||
@@ -1061,0 +1124,0 @@ * @type string|null |
@@ -1,2 +0,2 @@ | ||
# Platform.js v1.3.3 | ||
# Platform.js v1.3.4 | ||
@@ -3,0 +3,0 @@ A platform detection library that works on nearly all JavaScript platforms. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45085
1126