From df5229cb62e5cc037c6079770153946244319c4a Mon Sep 17 00:00:00 2001 From: Alvin Portillo Date: Fri, 30 Nov 2018 11:00:24 -0800 Subject: [PATCH 01/19] Fix Pixel XL devices on Chrome 70 --- src/ua-parser.js | 2 +- test/device-test.json | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index d982c4e..8321538 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -679,7 +679,7 @@ /android.+;\s(pixel c)[\s)]/i // Google Pixel C ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [ - /android.+;\s(pixel( [23])?( xl)?)\s/i // Google Pixel + /android.+;\s(pixel( [23])?( xl)?)[\s)]/i // Google Pixel ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [ /android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models diff --git a/test/device-test.json b/test/device-test.json index a283f76..5ef3679 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -647,6 +647,15 @@ "type": "mobile" } }, + { + "desc": "Google Pixel XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel XL", + "type": "mobile" + } + }, { "desc": "Google Pixel 2", "ua": "Mozilla/5.0 (Linux; Android 8.1.0; Pixel 2 Build/OPM1.171019.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Safari/537.36", @@ -665,6 +674,15 @@ "type": "mobile" } }, + { + "desc": "Google Pixel 2 XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 2 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 2 XL", + "type": "mobile" + } + }, { "desc": "Google Pixel 3", "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36", @@ -683,6 +701,15 @@ "type": "mobile" } }, + { + "desc": "Google Pixel 3 XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3 XL", + "type": "mobile" + } + }, { "desc": "Generic Android Device", "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; i980 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", From 6f27f8b8625a920d1f612a32b36acca8e0a2caf9 Mon Sep 17 00:00:00 2001 From: dianhe Date: Wed, 23 Jan 2019 14:32:30 +0800 Subject: [PATCH 02/19] + 'WeChat(Win) Desktop' --- src/ua-parser.js | 3 +++ test/browser-test.json | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/ua-parser.js b/src/ua-parser.js index 350425d..4242b1f 100644 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -270,6 +270,9 @@ /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION], [ + /(windowswechat qbcore)\/([\w\.]+)/i // WeChat Desktop for Windows Built-in Browser + ], [[NAME, 'WeChat(Win) Desktop'], VERSION], [ + /(micromessenger)\/([\w\.]+)/i // WeChat ], [[NAME, 'WeChat'], VERSION], [ diff --git a/test/browser-test.json b/test/browser-test.json index f3b8c3e..2fbe6cb 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -878,5 +878,15 @@ "version" : "6.5.8.2910", "major" : "6" } + }, + { + "desc" : "QQ on Android", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400", + "expect" : + { + "name" : "WeChat(Win) Desktop", + "version" : "3.43.901.400", + "major" : "3" + } } ] From bc4fd7417cca28bc637a25eff96484ac7023df64 Mon Sep 17 00:00:00 2001 From: dianhe Date: Wed, 23 Jan 2019 14:43:56 +0800 Subject: [PATCH 03/19] test name --- test/browser-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/browser-test.json b/test/browser-test.json index 2fbe6cb..1070946 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -880,7 +880,7 @@ } }, { - "desc" : "QQ on Android", + "desc" : "WeChat Desktop for Windows Built-in Browser", "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400", "expect" : { From 995e872ff8bcd91e1ed5cc106d47ad25a39cbd38 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Fri, 1 Mar 2019 14:48:14 +0200 Subject: [PATCH 04/19] Add Sailfish OS and Sailfish Browser detection --- src/ua-parser.js | 8 +++++--- test/browser-test.json | 10 ++++++++++ test/os-test.json | 9 +++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index d982c4e..208c67c 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -334,6 +334,9 @@ /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser ], [VERSION, [NAME, 'Android Browser']], [ + /(sailfishbrowser)\/([\w\.]+)/i // Sailfish Browser + ], [[NAME, 'Sailfish Browser'], VERSION], [ + /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION], [ @@ -864,9 +867,8 @@ ], [[NAME, 'BlackBerry'], VERSION], [ /(blackberry)\w*\/?([\w\.]*)/i, // Blackberry /(tizen)[\/\s]([\w\.]+)/i, // Tizen - /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i, - // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki - /linux;.+(sailfish);/i // Sailfish OS + /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i + // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS ], [NAME, VERSION], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i // Symbian ], [[NAME, 'Symbian'], VERSION], [ diff --git a/test/browser-test.json b/test/browser-test.json index b98db59..518241d 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -59,6 +59,16 @@ "major" : "3" } }, + { + "desc" : "Sailfish Browser", + "ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0", + "expect" : + { + "name" : "Sailfish Browser", + "version" : "1.0", + "major" : "1" + } + }, { "desc" : "Arora", "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-CH) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2", diff --git a/test/os-test.json b/test/os-test.json index 5dc4c1d..a2a2411 100644 --- a/test/os-test.json +++ b/test/os-test.json @@ -170,6 +170,15 @@ "version" : "2.2.2" } }, + { + "desc" : "Sailfish", + "ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0", + "expect" : + { + "name" : "Sailfish", + "version" : "3.0" + } + }, { "desc" : "WebOS", "ua" : "", From 97dc89ae03b955fb92e73b5640aa8cd83304ad0f Mon Sep 17 00:00:00 2001 From: Bendeguz Date: Tue, 19 Mar 2019 10:57:36 +0100 Subject: [PATCH 05/19] FIX: When using in an AMD module with RequireJS using a namespace, it does not get packed correctly, because r.js optimizer matches the exact line containing 'function' as a string. (See r.js@26506) --- src/ua-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index d982c4e..ebebfd5 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -1083,7 +1083,7 @@ exports.UAParser = UAParser; } else { // requirejs env (optional) - if (typeof(define) === FUNC_TYPE && define.amd) { + if (typeof(define) === 'function' && define.amd) { define(function () { return UAParser; }); From 795139e1b8bb6dd3c8f2d7a5798493be8c2adf27 Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Mon, 25 Mar 2019 11:54:55 +0100 Subject: [PATCH 06/19] Fix typo Changes `margedRegexes` -> `mergedRegexes` --- src/ua-parser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index d982c4e..3b7ea5a 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -45,15 +45,15 @@ var util = { extend : function (regexes, extensions) { - var margedRegexes = {}; + var mergedRegexes = {}; for (var i in regexes) { if (extensions[i] && extensions[i].length % 2 === 0) { - margedRegexes[i] = extensions[i].concat(regexes[i]); + mergedRegexes[i] = extensions[i].concat(regexes[i]); } else { - margedRegexes[i] = regexes[i]; + mergedRegexes[i] = regexes[i]; } } - return margedRegexes; + return mergedRegexes; }, has : function (str1, str2) { if (typeof str1 === "string") { From a4da1e2b659438d76cd6a40ce8010c26dfa0aee4 Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Mon, 25 Mar 2019 12:09:10 +0100 Subject: [PATCH 07/19] Remove outcommented code It was disabled 2 years ago, see #258 --- src/ua-parser.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index d982c4e..2055e07 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -924,22 +924,6 @@ ///////////////// // Constructor //////////////// - /* - var Browser = function (name, version) { - this[NAME] = name; - this[VERSION] = version; - }; - var CPU = function (arch) { - this[ARCHITECTURE] = arch; - }; - var Device = function (vendor, model, type) { - this[VENDOR] = vendor; - this[MODEL] = model; - this[TYPE] = type; - }; - var Engine = Browser; - var OS = Browser; - */ var UAParser = function (uastring, extensions) { if (typeof uastring === 'object') { @@ -953,11 +937,6 @@ var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); var rgxmap = extensions ? util.extend(regexes, extensions) : regexes; - //var browser = new Browser(); - //var cpu = new CPU(); - //var device = new Device(); - //var engine = new Engine(); - //var os = new OS(); this.getBrowser = function () { var browser = { name: undefined, version: undefined }; @@ -1000,11 +979,6 @@ }; this.setUA = function (uastring) { ua = uastring; - //browser = new Browser(); - //cpu = new CPU(); - //device = new Device(); - //engine = new Engine(); - //os = new OS(); return this; }; return this; From d1a7f365ad55c4be1ab24c186a8925185533129e Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Mon, 25 Mar 2019 12:11:07 +0100 Subject: [PATCH 08/19] Remove disabled CLI functionality See #268 --- readme.md | 12 ------------ src/ua-parser.js | 30 ------------------------------ 2 files changed, 42 deletions(-) diff --git a/readme.md b/readme.md index fb356c3..364810e 100644 --- a/readme.md +++ b/readme.md @@ -241,18 +241,6 @@ $ npm install --save @types/ua-parser-js # https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js ``` -## Using CLI - -```sh -$ node ua-parser.min.js "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)" -# multiple args -$ node ua-parser.min.js "Opera/1.2" "Opera/3.4" -# piped args -$ echo "Opera/1.2" | node ua-parser.min.js -# log file -$ cat ua.log | node ua-parser.min.js -``` - ## Using jQuery/Zepto ($.ua) Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`. diff --git a/src/ua-parser.js b/src/ua-parser.js index 2055e07..2593637 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -1012,7 +1012,6 @@ NAME : NAME, VERSION : VERSION }; - //UAParser.Utils = util; /////////// // Export @@ -1025,35 +1024,6 @@ if (typeof module !== UNDEF_TYPE && module.exports) { exports = module.exports = UAParser; } - // TODO: test!!!!!!!! - /* - if (require && require.main === module && process) { - // cli - var jsonize = function (arr) { - var res = []; - for (var i in arr) { - res.push(new UAParser(arr[i]).getResult()); - } - process.stdout.write(JSON.stringify(res, null, 2) + '\n'); - }; - if (process.stdin.isTTY) { - // via args - jsonize(process.argv.slice(2)); - } else { - // via pipe - var str = ''; - process.stdin.on('readable', function() { - var read = process.stdin.read(); - if (read !== null) { - str += read; - } - }); - process.stdin.on('end', function () { - jsonize(str.replace(/\n$/, '').split('\n')); - }); - } - } - */ exports.UAParser = UAParser; } else { // requirejs env (optional) From cc479f81ae0489b4872ea0d1544ef322e95382fa Mon Sep 17 00:00:00 2001 From: Max Nordlund gmail Date: Mon, 25 Mar 2019 12:14:31 +0100 Subject: [PATCH 09/19] Remove outcommented code Hasn't been used for years, so it's most likely safe to remove. --- src/ua-parser.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 2593637..01bca0e 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -83,14 +83,7 @@ rgx : function (ua, arrays) { - //var result = {}, - var i = 0, j, k, p, q, matches, match;//, args = arguments; - - /*// construct object barebones - for (p = 0; p < args[1].length; p++) { - q = args[1][p]; - result[typeof q === OBJ_TYPE ? q[0] : q] = undefined; - }*/ + var i = 0, j, k, p, q, matches, match; // loop through all regexes maps while (i < arrays.length && !matches) { @@ -138,8 +131,6 @@ } i += 2; } - // console.log(this); - //return this; }, str : function (str, map) { From 95f37b4ce5bc25dac82a2476899eaaf7c38d6170 Mon Sep 17 00:00:00 2001 From: Max Nordlund gmail Date: Mon, 25 Mar 2019 12:20:06 +0100 Subject: [PATCH 10/19] Remove unused media players This got disabled ~4 years ago, see 5d817e37 --- src/ua-parser.js | 111 ----------------------------------------------- 1 file changed, 111 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 01bca0e..e86c010 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -375,117 +375,6 @@ /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser /(mosaic)[\/\s]([\w\.]+)/i // Mosaic ], [NAME, VERSION] - - /* ///////////////////// - // Media players BEGIN - //////////////////////// - - , [ - - /(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, // Generic Apple CoreMedia - /(coremedia) v((\d+)[\w\._]+)/i - ], [NAME, VERSION], [ - - /(aqualung|lyssna|bsplayer)\/((\d+)?[\w\.-]+)/i // Aqualung/Lyssna/BSPlayer - ], [NAME, VERSION], [ - - /(ares|ossproxy)\s((\d+)[\w\.-]+)/i // Ares/OSSProxy - ], [NAME, VERSION], [ - - /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, - // Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC - // NSPlayer/PSP-InternetRadioPlayer/Videos - /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, // Clementine/MPD - /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, - /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i // NexPlayer/LG Player - ], [NAME, VERSION], [ - /(nexplayer)\s((\d+)[\w\.-]+)/i // Nexplayer - ], [NAME, VERSION], [ - - /(flrp)\/((\d+)[\w\.-]+)/i // Flip Player - ], [[NAME, 'Flip Player'], VERSION], [ - - /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i - // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit - ], [NAME], [ - - /(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i - // Gstreamer - ], [NAME, VERSION], [ - - /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, // HTC Streaming Player - /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, - // Java/urllib/requests/wget/cURL - /(lavf)((\d+)[\d\.]+)/i // Lavf (FFMPEG) - ], [NAME, VERSION], [ - - /(htc_one_s)\/((\d+)[\d\.]+)/i // HTC One S - ], [[NAME, /_/g, ' '], VERSION], [ - - /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i - // MPlayer SVN - ], [NAME, VERSION], [ - - /(mplayer)(?:\s|\/|[unkow-]+)((\d+)[\w\.-]+)/i // MPlayer - ], [NAME, VERSION], [ - - /(mplayer)/i, // MPlayer (no other info) - /(yourmuze)/i, // YourMuze - /(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime - ], [NAME], [ - - /(nero (?:home|scout))\/((\d+)[\w\.-]+)/i // Nero Home/Nero Scout - ], [NAME, VERSION], [ - - /(nokia\d+)\/((\d+)[\w\.-]+)/i // Nokia - ], [NAME, VERSION], [ - - /\s(songbird)\/((\d+)[\w\.-]+)/i // Songbird/Philips-Songbird - ], [NAME, VERSION], [ - - /(winamp)3 version ((\d+)[\w\.-]+)/i, // Winamp - /(winamp)\s((\d+)[\w\.-]+)/i, - /(winamp)mpeg\/((\d+)[\w\.-]+)/i - ], [NAME, VERSION], [ - - /(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info) - // inlight radio - ], [NAME], [ - - /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i - // QuickTime/RealMedia/RadioApp/RadioClientApplication/ - // SoundTap/Totem/Stagefright/Streamium - ], [NAME, VERSION], [ - - /(smp)((\d+)[\d\.]+)/i // SMP - ], [NAME, VERSION], [ - - /(vlc) media player - version ((\d+)[\w\.]+)/i, // VLC Videolan - /(vlc)\/((\d+)[\w\.-]+)/i, - /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp - /(foobar2000)\/((\d+)[\d\.]+)/i, // Foobar2000 - /(itunes)\/((\d+)[\d\.]+)/i // iTunes - ], [NAME, VERSION], [ - - /(wmplayer)\/((\d+)[\w\.-]+)/i, // Windows Media Player - /(windows-media-player)\/((\d+)[\w\.-]+)/i - ], [[NAME, /-/g, ' '], VERSION], [ - - /windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i - // Windows Media Server - ], [VERSION, [NAME, 'Windows']], [ - - /(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i // RiseUP Radio Alarm - ], [NAME, VERSION], [ - - /(rad.io)\s((\d+)[\d\.]+)/i, // Rad.io - /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i - ], [[NAME, 'rad.io'], VERSION] - - ////////////////////// - // Media players END - ////////////////////*/ - ], cpu : [[ From 37cac21d0cb0e04c2d097dc01248a7b9df7483d0 Mon Sep 17 00:00:00 2001 From: Max Nordlund gmail Date: Mon, 25 Mar 2019 12:23:21 +0100 Subject: [PATCH 11/19] Remove outdated TODO This todo was written in April 2015, which at the time of this commit is almost 4 years ago. See 6a284e26 --- src/ua-parser.js | 52 ------------------------------------------------ 1 file changed, 52 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index e86c010..13830cd 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -654,58 +654,6 @@ /(android[\w\.\s\-]{0,9});.+build/i // Generic Android Device ], [MODEL, [VENDOR, 'Generic']] - - - /*////////////////////////// - // TODO: move to string map - //////////////////////////// - - /(C6603)/i // Sony Xperia Z C6603 - ], [[MODEL, 'Xperia Z C6603'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [ - /(C6903)/i // Sony Xperia Z 1 - ], [[MODEL, 'Xperia Z 1'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [ - - /(SM-G900[F|H])/i // Samsung Galaxy S5 - ], [[MODEL, 'Galaxy S5'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ - /(SM-G7102)/i // Samsung Galaxy Grand 2 - ], [[MODEL, 'Galaxy Grand 2'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ - /(SM-G530H)/i // Samsung Galaxy Grand Prime - ], [[MODEL, 'Galaxy Grand Prime'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ - /(SM-G313HZ)/i // Samsung Galaxy V - ], [[MODEL, 'Galaxy V'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ - /(SM-T805)/i // Samsung Galaxy Tab S 10.5 - ], [[MODEL, 'Galaxy Tab S 10.5'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [ - /(SM-G800F)/i // Samsung Galaxy S5 Mini - ], [[MODEL, 'Galaxy S5 Mini'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ - /(SM-T311)/i // Samsung Galaxy Tab 3 8.0 - ], [[MODEL, 'Galaxy Tab 3 8.0'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [ - - /(T3C)/i // Advan Vandroid T3C - ], [MODEL, [VENDOR, 'Advan'], [TYPE, TABLET]], [ - /(ADVAN T1J\+)/i // Advan Vandroid T1J+ - ], [[MODEL, 'Vandroid T1J+'], [VENDOR, 'Advan'], [TYPE, TABLET]], [ - /(ADVAN S4A)/i // Advan Vandroid S4A - ], [[MODEL, 'Vandroid S4A'], [VENDOR, 'Advan'], [TYPE, MOBILE]], [ - - /(V972M)/i // ZTE V972M - ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [ - - /(i-mobile)\s(IQ\s[\d\.]+)/i // i-mobile IQ - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - /(IQ6.3)/i // i-mobile IQ IQ 6.3 - ], [[MODEL, 'IQ 6.3'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [ - /(i-mobile)\s(i-style\s[\d\.]+)/i // i-mobile i-STYLE - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - /(i-STYLE2.1)/i // i-mobile i-STYLE 2.1 - ], [[MODEL, 'i-STYLE 2.1'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [ - - /(mobiistar touch LAI 512)/i // mobiistar touch LAI 512 - ], [[MODEL, 'Touch LAI 512'], [VENDOR, 'mobiistar'], [TYPE, MOBILE]], [ - - ///////////// - // END TODO - ///////////*/ - ], engine : [[ From a88b70bdd4ad9c04677f7e51415c6551b2ca3789 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Sat, 13 Apr 2019 10:48:53 +0300 Subject: [PATCH 12/19] Fixed Edge Chromium detection Closes #373 --- dist/ua-parser.min.js | 2 +- dist/ua-parser.pack.js | 2 +- src/ua-parser.js | 2 +- test/browser-test.json | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dist/ua-parser.min.js b/dist/ua-parser.min.js index c12f2ef..ed48f0a 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -6,4 +6,4 @@ * Copyright © 2012-2016 Faisal Salman * Dual licensed under GPLv2 or MIT */ -(function(window,undefined){"use strict";var LIBVERSION="0.7.19",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var margedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){margedRegexes[i]=extensions[i].concat(regexes[i])}else{margedRegexes[i]=regexes[i]}}return margedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j * Dual licensed under GPLv2 or MIT */ -!function(i,s){"use strict";var e="0.7.19",o="",r="?",n="function",a="undefined",d="object",t="string",l="major",w="model",u="name",c="type",m="vendor",b="version",p="architecture",g="console",f="mobile",h="tablet",v="smarttv",x="wearable",k="embedded",y={extend:function(i,s){var e={};for(var o in i)s[o]&&s[o].length%2===0?e[o]=s[o].concat(i[o]):e[o]=i[o];return e},has:function(i,s){return"string"==typeof i&&s.toLowerCase().indexOf(i.toLowerCase())!==-1},lowerize:function(i){return i.toLowerCase()},major:function(i){return typeof i===t?i.replace(/[^\d\.]/g,"").split(".")[0]:s},trim:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},T={rgx:function(i,e){for(var o,r,a,t,l,w,u=0;u0?2==t.length?typeof t[1]==n?this[t[0]]=t[1].call(this,w):this[t[0]]=t[1]:3==t.length?typeof t[1]!==n||t[1].exec&&t[1].test?this[t[0]]=w?w.replace(t[1],t[2]):s:this[t[0]]=w?t[1].call(this,w,t[2]):s:4==t.length&&(this[t[0]]=w?t[3].call(this,w.replace(t[1],t[2])):s):this[t]=w?w:s;u+=2}},str:function(i,e){for(var o in e)if(typeof e[o]===d&&e[o].length>0){for(var n=0;n0?2==t.length?typeof t[1]==n?this[t[0]]=t[1].call(this,w):this[t[0]]=t[1]:3==t.length?typeof t[1]!==n||t[1].exec&&t[1].test?this[t[0]]=w?w.replace(t[1],t[2]):s:this[t[0]]=w?t[1].call(this,w,t[2]):s:4==t.length&&(this[t[0]]=w?t[3].call(this,w.replace(t[1],t[2])):s):this[t]=w?w:s;u+=2}},str:function(i,e){for(var o in e)if(typeof e[o]===d&&e[o].length>0){for(var n=0;n Date: Wed, 5 Jun 2019 16:48:01 +0200 Subject: [PATCH 13/19] fix license in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9686761..0485507 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "type": "git", "url": "https://github.com/faisalman/ua-parser-js.git" }, - "license": "(GPL-2.0 OR MIT)", + "license": "MIT", "engines": { "node": "*" }, From 90ae87ec17b9ae2ee3637c2a17429c3c445a9e20 Mon Sep 17 00:00:00 2001 From: Elchin Valiyev Date: Wed, 5 Jun 2019 17:01:30 +0200 Subject: [PATCH 14/19] Update README --- readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index fb356c3..9a5c1d4 100644 --- a/readme.md +++ b/readme.md @@ -325,18 +325,18 @@ Do you use & like UAParser.js but you don’t find a way to show some love? If y # License -Dual licensed under GPLv2 or MIT +MIT License -Copyright © 2012-2018 Faisal Salman <> +Copyright (c) 2012-2019 Faisal Salman <> -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR From 7ef62a68de0880f3a5ff4956ec9443ba127ac33c Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 8 Jun 2019 20:28:14 +0700 Subject: [PATCH 15/19] Fix #318 Detect Meizu Note as Mobile --- src/ua-parser.js | 6 +++--- test/device-test.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 6c5be8b..b42443a 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -575,9 +575,9 @@ ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ /android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i // Mi Pad tablets ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [ - /android.+;\s(m[1-5]\snote)\sbuild/i // Meizu Tablet - ], [MODEL, [VENDOR, 'Meizu'], [TYPE, TABLET]], [ - /(mz)-([\w-]{2,})/i // Meizu Phone + /android.+;\s(m[1-5]\snote)\sbuild/i // Meizu + ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ + /(mz)-([\w-]{2,})/i ], [[VENDOR, 'Meizu'], MODEL, [TYPE, MOBILE]], [ /android.+a000(1)\s+build/i, // OnePlus diff --git a/test/device-test.json b/test/device-test.json index 5ef3679..3b837c4 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -157,7 +157,7 @@ "expect": { "vendor": "Meizu", "model": "M5 Note", - "type": "tablet" + "type": "mobile" } }, { From a9fc6163b86269b48b3a26e63f4c5782fb4061cf Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 8 Jun 2019 20:39:31 +0700 Subject: [PATCH 16/19] Fix #289 Detect Xiaomi Mi as Mobile --- src/ua-parser.js | 3 ++- test/device-test.json | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index b42443a..3960cc6 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -570,7 +570,8 @@ /android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi - /android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i, // Xiaomi Mi + /android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i, + // Xiaomi Mi /android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i // Redmi Phones ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ /android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i // Mi Pad tablets diff --git a/test/device-test.json b/test/device-test.json index 3b837c4..7478c9c 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -522,6 +522,15 @@ "type": "mobile" } }, + { + "desc": "Xiaomi Mi A1", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; Mi A1 Build/OPR1.170623.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi A1", + "type": "mobile" + } + }, { "desc": "Xiaomi Mi Note", "ua": "Mozilla/5.0 (Linux; Android 4.4.4; MI NOTE LTE Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36", From b1d6eda6e1d13f6fa2d33d9b154b0a732f1795d3 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 8 Jun 2019 20:51:31 +0700 Subject: [PATCH 17/19] Fix #378 Detect Samsung Galaxy C9 Pro --- test/device-test.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/device-test.json b/test/device-test.json index 7478c9c..865337a 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -567,6 +567,15 @@ "type": "mobile" } }, + { + "desc": "Samsung Galaxy C9 Pro", + "ua": "Mozilla/5.0 (Linux; Android 6.0; SAMSUNG SM-C900F Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.2 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-C900F", + "type": "mobile" + } + }, { "desc": "Samsung Galaxy S5", "ua": "Mozilla/5.0 (Linux; Android 5.0; SM-G900F Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile Safari/537.36", From 8cf2a8793822dc56960891176f95d7e1e0611732 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 8 Jun 2019 21:10:52 +0700 Subject: [PATCH 18/19] Fix #379 Detect Lenovo Tab --- src/ua-parser.js | 11 ++++++----- test/device-test.json | 9 +++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 3960cc6..36b1bd5 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -471,13 +471,10 @@ /(sprint\s(\w+))/i // Sprint Phones ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [ - /(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - /(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC /(zte)-(\w*)/i, // ZTE - /(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i - // Alcatel/GeeksPhone/Lenovo/Nexian/Panasonic/Sony + /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i + // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ /(nexus\s9)/i // HTC Nexus 9 @@ -544,8 +541,12 @@ /android.+lg(\-?[\d\w]+)\s+build/i ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [ + /(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i // Lenovo tablets + ], [VENDOR, MODEL, [TYPE, TABLET]], [ /android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ + /(lenovo)[_\s-]?([\w-]+)/i + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /linux;.+((jolla));/i // Jolla ], [VENDOR, MODEL, [TYPE, MOBILE]], [ diff --git a/test/device-test.json b/test/device-test.json index 865337a..6074665 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -133,6 +133,15 @@ "type": "mobile" } }, + { + "desc": "Lenovo Tab 2", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; Lenovo TAB 2 A7-30HC Build/LRX21M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TAB 2 A7", + "type": "tablet" + } + }, { "desc": "LG Nexus 4", "ua": "Mozilla/5.0 (Linux; Android 4.2.1; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", From a88934fadf2393f3757f1e8b9966d8c0244120b1 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 8 Jun 2019 21:49:59 +0700 Subject: [PATCH 19/19] v0.7.20 - released under the MIT license --- bower.json | 4 ++-- dist/ua-parser.min.js | 8 ++++---- dist/ua-parser.pack.js | 8 ++++---- license.md | 2 +- package.js | 2 +- package.json | 2 +- src/ua-parser.js | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bower.json b/bower.json index c83d0a9..d7496a9 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ua-parser-js", - "version": "0.7.19", + "version": "0.7.20", "authors": [ - "Faisal Salman " + "Faisal Salman " ], "private": false, "main": "src/ua-parser.js", diff --git a/dist/ua-parser.min.js b/dist/ua-parser.min.js index ed48f0a..6e8acb3 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -1,9 +1,9 @@ /*! - * UAParser.js v0.7.19 + * UAParser.js v0.7.20 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2016 Faisal Salman - * Dual licensed under GPLv2 or MIT + * Copyright © 2012-2019 Faisal Salman + * Licensed under MIT License */ -(function(window,undefined){"use strict";var LIBVERSION="0.7.19",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j - * Dual licensed under GPLv2 or MIT + * Copyright © 2012-2019 Faisal Salman + * Licensed under MIT License */ -!function(i,s){"use strict";var e="0.7.19",o="",r="?",n="function",a="undefined",d="object",t="string",l="major",w="model",u="name",c="type",m="vendor",b="version",p="architecture",f="console",g="mobile",h="tablet",v="smarttv",x="wearable",k="embedded",y={extend:function(i,s){var e={};for(var o in i)s[o]&&s[o].length%2===0?e[o]=s[o].concat(i[o]):e[o]=i[o];return e},has:function(i,s){return"string"==typeof i&&s.toLowerCase().indexOf(i.toLowerCase())!==-1},lowerize:function(i){return i.toLowerCase()},major:function(i){return typeof i===t?i.replace(/[^\d\.]/g,"").split(".")[0]:s},trim:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},T={rgx:function(i,e){for(var o,r,a,t,l,w,u=0;u0?2==t.length?typeof t[1]==n?this[t[0]]=t[1].call(this,w):this[t[0]]=t[1]:3==t.length?typeof t[1]!==n||t[1].exec&&t[1].test?this[t[0]]=w?w.replace(t[1],t[2]):s:this[t[0]]=w?t[1].call(this,w,t[2]):s:4==t.length&&(this[t[0]]=w?t[3].call(this,w.replace(t[1],t[2])):s):this[t]=w?w:s;u+=2}},str:function(i,e){for(var o in e)if(typeof e[o]===d&&e[o].length>0){for(var n=0;n> +Copyright (c) 2012-2019 Faisal Salman <> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.js b/package.js index adff37c..e41d5e7 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'faisalman:ua-parser-js', - version: '0.7.19', + version: '0.7.20', summary: 'Lightweight JavaScript-based user-agent string parser', git: 'https://github.com/faisalman/ua-parser-js.git', documentation: 'readme.md' diff --git a/package.json b/package.json index 0485507..8b6c554 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "UAParser.js", "name": "ua-parser-js", - "version": "0.7.19", + "version": "0.7.20", "author": "Faisal Salman (http://faisalman.com)", "description": "Lightweight JavaScript-based user-agent string parser", "keywords": [ diff --git a/src/ua-parser.js b/src/ua-parser.js index 36b1bd5..de0579c 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -1,10 +1,10 @@ /*! - * UAParser.js v0.7.19 + * UAParser.js v0.7.20 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2016 Faisal Salman - * Dual licensed under GPLv2 or MIT + * Copyright © 2012-2019 Faisal Salman + * Licensed under MIT License */ (function (window, undefined) { @@ -16,7 +16,7 @@ ///////////// - var LIBVERSION = '0.7.19', + var LIBVERSION = '0.7.20', EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function',