Skip to content

Commit

Permalink
Bump version 2.0.0-alpha.3
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Aug 17, 2023
1 parent 6e26e38 commit d168b75
Show file tree
Hide file tree
Showing 16 changed files with 262 additions and 112 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "2.0.0-alpha.2",
"version": "2.0.0-alpha.3",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
- Add support for ES module `import { UAParser } from 'ua-parser-js'`
- Provide Enums `'ua-parser-js/enums'`
- Provide Extensions `'ua-parser-js/extensions'`
- Provide Helpers `'ua-parser-js/helpers'`

## Version 2.0.0-alpha.3
- Add `withFeatureCheck()` method
- Add `isFrozenUA()` method in `helpers` submodule
- Add `MediaPlayers` & `Modules` in `extensions` submodule
- Fix issue with ESM import

## Version 2.0.0-alpha.2
- Fix browser result always returning Chromium when using `withClientHints()`
Expand Down
4 changes: 2 additions & 2 deletions dist/ua-parser.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/ua-parser.pack.js

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions images/51degrees.svg

This file was deleted.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '2.0.0-alpha.2',
version: '2.0.0-alpha.3',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "2.0.0-alpha.2",
"version": "2.0.0-alpha.3",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/enums/ua-parser-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-alpha.2
/* Enums for UAParser.js v2.0.0-alpha.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
2 changes: 1 addition & 1 deletion src/enums/ua-parser-enums.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Source: /src/enums/ua-parser-enums.js

///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-alpha.2
/* Enums for UAParser.js v2.0.0-alpha.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/ua-parser-extensions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-alpha.2
/* Extensions for UAParser.js v2.0.0-alpha.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
236 changes: 176 additions & 60 deletions src/extensions/ua-parser-extensions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Source: /src/extensions/ua-parser-extensions.js

///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-alpha.2
/* Extensions for UAParser.js v2.0.0-alpha.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand All @@ -28,109 +28,225 @@ const Apps = Object.freeze({
const Bots = Object.freeze({
browser : [
// Googlebot / BingBot / MSNBot / FacebookBot
[/((?:google|bing|msn|facebook)bot(?:\-[imagevdo]{5})?|bingpreview)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],
[/((?:google|bing|msn|facebook)bot(?:[\-imagevdo]{0,6})|bingpreview)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],

// GPTBot - https://platform.openai.com/docs/gptbot
[/(gptbot)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],

// Slackbot - https://api.slack.com/robots
[/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']]
]
});

const CLIs = Object.freeze({
browser : [
// wget / curl / lynx
[/(wget|curl|lynx)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'cli']]
]
});

const ExtraDevices = Object.freeze({
device : [
[
/(nook)[\w ]+build\/(\w+)/i, // Nook
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
], [VENDOR, MODEL, [TYPE, TABLET]], [
device : [[
/(nook)[\w ]+build\/(\w+)/i, // Nook
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
], [VENDOR, MODEL, [TYPE, TABLET]], [

/(u304aa)/i // AT&T
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
/(u304aa)/i // AT&T
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [

/\bsie-(\w*)/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/\bsie-(\w*)/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [

/\b(rct\w+) b/i // RCA Tablets
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
/\b(rct\w+) b/i // RCA Tablets
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [

/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [

/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [

/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [

/\b(tm\d{3}\w+) b/i
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
/\b(tm\d{3}\w+) b/i
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [

/\b(k88) b/i // ZTE K Series Tablet
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
/\b(k88) b/i // ZTE K Series Tablet
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [

/\b(nx\d{3}j) b/i // ZTE Nubia
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
/\b(nx\d{3}j) b/i // ZTE Nubia
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [

/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [

/\b(zur\d{3}) b/i // Swiss ZUR Tablet
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
/\b(zur\d{3}) b/i // Swiss ZUR Tablet
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [

/\b((zeki)?tb.*\b) b/i // Zeki Tablets
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
/\b((zeki)?tb.*\b) b/i // Zeki Tablets
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [

/\b([yr]\d{2}) b/i,
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [
/\b([yr]\d{2}) b/i,
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [

/\b(ns-?\w{0,9}) b/i // Insignia Tablets
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
/\b(ns-?\w{0,9}) b/i // Insignia Tablets
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [

/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [

/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [

/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [

/\b(ph-1) /i // Essential PH-1
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [
/\b(ph-1) /i // Essential PH-1
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [

/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [

/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [

/\btu_(1491) b/i // Rotor Tablets
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]
]
/\btu_(1491) b/i // Rotor Tablets
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]]
]
});

const Emails = Object.freeze({
browser : [
// Microsoft Outlook / Thunderbird
// Microsoft Outlook / Thunderbird
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, 'email']]
]
});

const CLI = Object.freeze({
const MediaPlayers = Object.freeze({
browser : [[

/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
/(coremedia) v([\w\._]+)/i
], [NAME, VERSION], [

/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
], [NAME, VERSION], [

/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
], [NAME, VERSION], [

/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
// NSPlayer/PSP-InternetRadioPlayer/Videos
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
/(lg player|nexplayer)\s([\d\.]+)/i,
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
], [NAME, VERSION], [
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
], [NAME, VERSION], [

/(flrp)\/([\w\.-]+)/i // Flip Player
], [[NAME, 'Flip Player'], VERSION], [

/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
], [NAME], [

/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
// Gstreamer
], [NAME, VERSION], [

/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
// Java/urllib/requests/wget/cURL
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
], [NAME, VERSION], [

/(htc_one_s)\/([\d\.]+)/i, // HTC One S
], [[NAME, /_/g, ' '], VERSION], [

/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
// MPlayer SVN
], [NAME, VERSION], [

/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
], [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))\/([\w\.-]+)/i // Nero Home/Nero Scout
], [NAME, VERSION], [

/(nokia\d+)\/([\w\.-]+)/i // Nokia
], [NAME, VERSION], [

/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
], [NAME, VERSION], [

/(winamp)3 version ([\w\.-]+)/i, // Winamp
/(winamp)\s([\w\.-]+)/i,
/(winamp)mpeg\/([\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)\/([\w\.-]+)/i
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
// SoundTap/Totem/Stagefright/Streamium
], [NAME, VERSION], [

/(smp)([\d\.]+)/i // SMP
], [NAME, VERSION], [

/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
/(vlc)\/([\w\.-]+)/i,
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
/(itunes)\/([\d\.]+)/i // iTunes
], [NAME, VERSION], [

/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
/(windows-media-player)\/([\w\.-]+)/i
], [[NAME, /-/g, ' '], VERSION], [

/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
// Windows Media Server
], [VERSION, [NAME, 'Windows']], [

/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
], [NAME, VERSION], [

/(rad.io)\s([\d\.]+)/i, // Rad.io
/(radio.(?:de|at|fr))\s([\d\.]+)/i
], [[NAME, 'rad.io'], VERSION]
]
});

const Modules = Object.freeze({
browser : [
// wget / curl / lynx
[/(wget|curl|lynx)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'cli']]
// Axios/jsdom/Scrapy
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'module']]
]
});

export {
Apps,
Bots,
CLIs,
ExtraDevices,
Emails,
CLI
MediaPlayers,
Modules
};
2 changes: 1 addition & 1 deletion src/helpers/ua-parser-helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Helpers for UAParser.js v2.0.0-alpha.2
/* Helpers for UAParser.js v2.0.0-alpha.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
Loading

0 comments on commit d168b75

Please sign in to comment.