mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Merge branch 'master' into develop
This commit is contained in:
commit
f726dcd1ae
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.26",
|
"version": "0.7.27",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Faisal Salman <f@faisalman.com>"
|
"Faisal Salman <f@faisalman.com>"
|
||||||
],
|
],
|
||||||
|
4
dist/ua-parser.min.js
vendored
4
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/ua-parser.pack.js
vendored
4
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
Package.describe({
|
Package.describe({
|
||||||
name: 'faisalman:ua-parser-js',
|
name: 'faisalman:ua-parser-js',
|
||||||
version: '0.7.26',
|
version: '0.7.27',
|
||||||
summary: 'Lightweight JavaScript-based user-agent string parser',
|
summary: 'Lightweight JavaScript-based user-agent string parser',
|
||||||
git: 'https://github.com/faisalman/ua-parser-js.git',
|
git: 'https://github.com/faisalman/ua-parser-js.git',
|
||||||
documentation: 'readme.md'
|
documentation: 'readme.md'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.26",
|
"version": "0.7.27",
|
||||||
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -62,8 +62,8 @@ console, mobile, tablet, smarttv, wearable, embedded
|
|||||||
|
|
||||||
# Possible 'device.vendor':
|
# Possible 'device.vendor':
|
||||||
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
|
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
|
||||||
Essential, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu,
|
Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG,
|
||||||
Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya,
|
Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya,
|
||||||
Palm, Panasonic, Pebble, Polytron, Realme, RIM, Samsung, Sharp, Siemens,
|
Palm, Panasonic, Pebble, Polytron, Realme, RIM, Samsung, Sharp, Siemens,
|
||||||
Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
|
Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!@license
|
/*!@license
|
||||||
* UAParser.js v0.7.26
|
* UAParser.js v0.7.27
|
||||||
* Lightweight JavaScript-based User-Agent string parser
|
* Lightweight JavaScript-based User-Agent string parser
|
||||||
* https://github.com/faisalman/ua-parser-js
|
* https://github.com/faisalman/ua-parser-js
|
||||||
*
|
*
|
||||||
@ -16,7 +16,7 @@
|
|||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
|
|
||||||
var LIBVERSION = '0.7.26',
|
var LIBVERSION = '0.7.27',
|
||||||
EMPTY = '',
|
EMPTY = '',
|
||||||
UNKNOWN = '?',
|
UNKNOWN = '?',
|
||||||
FUNC_TYPE = 'function',
|
FUNC_TYPE = 'function',
|
||||||
@ -541,6 +541,8 @@
|
|||||||
|
|
||||||
/\s(surface\sduo)\s/i // Surface Duo
|
/\s(surface\sduo)\s/i // Surface Duo
|
||||||
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, TABLET]], [
|
||||||
|
/droid\s[\d\.]+;\s(fp\du?)\sbuild/i
|
||||||
|
], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [
|
||||||
/\s(u304aa)\sbuild/i // AT&T
|
/\s(u304aa)\sbuild/i // AT&T
|
||||||
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
|
||||||
/sie-(\w*)/i // Siemens
|
/sie-(\w*)/i // Siemens
|
||||||
@ -814,7 +816,7 @@
|
|||||||
return _ua;
|
return _ua;
|
||||||
};
|
};
|
||||||
this.setUA = function (ua) {
|
this.setUA = function (ua) {
|
||||||
_ua = ua.length > UA_MAX_LENGTH ? util.trim(ua, UA_MAX_LENGTH) : ua;
|
_ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? util.trim(ua, UA_MAX_LENGTH) : ua;
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
this.setUA(_ua);
|
this.setUA(_ua);
|
||||||
|
@ -196,6 +196,15 @@
|
|||||||
"type": "mobile"
|
"type": "mobile"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc": "Fairphone 1U",
|
||||||
|
"ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; FP1U Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
||||||
|
"expect": {
|
||||||
|
"vendor": "Fairphone",
|
||||||
|
"model": "FP1U",
|
||||||
|
"type": "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc": "HTC Desire 820",
|
"desc": "HTC Desire 820",
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; HTC Desire 820 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36",
|
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; HTC Desire 820 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36",
|
||||||
|
@ -46,6 +46,14 @@ describe('UAParser()', function () {
|
|||||||
assert.deepStrictEqual(UAParser(ua), new UAParser().setUA(ua).getResult());
|
assert.deepStrictEqual(UAParser(ua), new UAParser().setUA(ua).getResult());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('UAParser() constructor does not throw with undefined ua argument', function () {
|
||||||
|
assert.doesNotThrow(() => new UAParser(undefined).getResult());
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('UAParser.setUA method does not throw with undefined ua argument', function () {
|
||||||
|
assert.doesNotThrow(() => new UAParser().setUA(undefined).getResult());
|
||||||
|
});
|
||||||
|
|
||||||
for (var i in methods) {
|
for (var i in methods) {
|
||||||
describe(methods[i]['title'], function () {
|
describe(methods[i]['title'], function () {
|
||||||
for (var j in methods[i]['list']) {
|
for (var j in methods[i]['list']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user