Skip to content

Commit 67005e3

Browse files
committed
Update patch version to 1.0.33 as a mirror of 0.7.33
2 parents a2b2e80 + f2d0db0 commit 67005e3

File tree

9 files changed

+63
-13
lines changed

9 files changed

+63
-13
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ua-parser-js",
3-
"version": "1.0.32",
3+
"version": "1.0.33",
44
"authors": [
55
"Faisal Salman <[email protected]>"
66
],

dist/ua-parser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ua-parser.pack.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'faisalman:ua-parser-js',
3-
version: '1.0.32',
3+
version: '1.0.33',
44
summary: 'Lightweight JavaScript-based user-agent string parser',
55
git: 'https://github.com/faisalman/ua-parser-js.git',
66
documentation: 'readme.md'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "UAParser.js",
33
"name": "ua-parser-js",
4-
"version": "1.0.32",
4+
"version": "1.0.33",
55
"author": "Faisal Salman <[email protected]> (http://faisalman.com)",
66
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
77
"keywords": [

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Like so:
3636
```js
3737
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
3838
console.log(parser); // {}
39-
let parserResults = parser.getResults();
39+
let parserResults = parser.getResult();
4040
console.log(parserResults);
4141
/** {
4242
"ua": "",
@@ -48,7 +48,7 @@ console.log(parserResults);
4848
} */
4949
```
5050

51-
When you call UAParser without the `new` keyword, it will automatically call `getResults()` function and return the parsed results.
51+
When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
5252
* `UAParser([uastring][,extensions])`
5353
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
5454

src/ua-parser.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/////////////////////////////////////////////////////////////////////////////////
2-
/* UAParser.js v1.0.32
2+
/* UAParser.js v1.0.33
33
Copyright © 2012-2021 Faisal Salman <[email protected]>
44
MIT License *//*
55
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
@@ -17,7 +17,7 @@
1717
/////////////
1818

1919

20-
var LIBVERSION = '1.0.32',
20+
var LIBVERSION = '1.0.33',
2121
EMPTY = '',
2222
UNKNOWN = '?',
2323
FUNC_TYPE = 'function',
@@ -93,7 +93,7 @@
9393
},
9494
trim = function (str, len) {
9595
if (typeof(str) === STR_TYPE) {
96-
str = str.replace(/^\s\s*/, EMPTY).replace(/\s\s*$/, EMPTY);
96+
str = str.replace(/^\s\s*/, EMPTY);
9797
return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
9898
}
9999
};
@@ -330,7 +330,10 @@
330330
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
331331
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
332332
/(links) \(([\w\.]+)/i // Links
333-
], [NAME, VERSION]
333+
], [NAME, VERSION], [
334+
335+
/(cobalt)\/([\w\.]+)/i // Cobalt
336+
], [NAME, [VERSION, /master.|lts./, ""]]
334337
],
335338

336339
cpu : [[
@@ -387,6 +390,8 @@
387390
/applecoremedia\/[\w\.]+ \((ipad)/i,
388391
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
389392
], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [
393+
/(macintosh);/i
394+
], [MODEL, [VENDOR, APPLE]], [
390395

391396
// Huawei
392397
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i

test/browser-test.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,5 +1591,41 @@
15911591
"version" : "15.6,2",
15921592
"major" : "15"
15931593
}
1594+
},
1595+
{
1596+
"desc" : "Cobalt 23 Master",
1597+
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.master.0.0-devel (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
1598+
"expect" : {
1599+
"name" : "Cobalt",
1600+
"version": "23.0.0",
1601+
"major" : "23"
1602+
}
1603+
},
1604+
{
1605+
"desc" : "Cobalt 23 LTS",
1606+
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.lts.1.0-qa (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
1607+
"expect" : {
1608+
"name" : "Cobalt",
1609+
"version": "23.1.0",
1610+
"major" : "23"
1611+
}
1612+
},
1613+
{
1614+
"desc" : "Cobalt 11",
1615+
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/11.0-qa (unlike Gecko) Starboard/6",
1616+
"expect" : {
1617+
"name" : "Cobalt",
1618+
"version": "11.0",
1619+
"major" : "11"
1620+
}
1621+
},
1622+
{
1623+
"desc" : "Cobalt 9",
1624+
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/9.0-qa (unlike Gecko) Starboard/4",
1625+
"expect" : {
1626+
"name" : "Cobalt",
1627+
"version": "9.0",
1628+
"major" : "9"
1629+
}
15941630
}
15951631
]

test/device-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,15 @@
754754
"type": "mobile"
755755
}
756756
},
757+
{
758+
"desc": "Apple Desktop",
759+
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15",
760+
"expect": {
761+
"vendor": "Apple",
762+
"model": "Macintosh",
763+
"type": "undefined"
764+
}
765+
},
757766
{
758767
"desc": "iPad using UCBrowser",
759768
"ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3",

0 commit comments

Comments
 (0)