Skip to content

Commit

Permalink
Update version to 2.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Nov 7, 2024
1 parent 0808d1d commit a1644b6
Show file tree
Hide file tree
Showing 17 changed files with 150 additions and 81 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ assignees: ''
**Library version**
Which version of the library that you use, eg: v0.7.35 or v2.0.0-alpha.3

For the issue related with detection result, you can use the demo section in https://uaparser.dev to confirm

**Describe the bug**
A clear and concise description of what the bug is.

Expand All @@ -23,11 +21,13 @@ Steps to reproduce the behavior:
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.
A clear and concise description of what you expected to happen, or what's referred in the docs https://docs.uaparser.dev/

**Screenshots**
If applicable, add screenshots to help explain your problem.

For issues related to detection results, you can send the screenshots of the demo section at https://uaparser.dev/#demo to confirm.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
Expand All @@ -40,4 +40,4 @@ If applicable, add screenshots to help explain your problem.
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
62 changes: 41 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# UAParser.js Changelog

## Migrating from v1 to v2

- What's breaking:
- Licensed under AGPLv3 (open-source) or PRO License (commercial)
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- What's new:
- New device type: `xr`, to identify AR/VR devices
- New browser property: `browser.type`, to identify the type of the browser: `crawler`, `cli`, `email`, `fetcher`, `inapp`, `mediaplayer`, `module`
- New methods in result object (all of `get*()` return value):
- Support for client hints: `withClientHints()`
- Support for feature detection: `withFeatureCheck()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Parse directly from command line using `npx ua-parser-js`
- Extensions can be passed as a list to `UAParser()`
- Support for ES module & TypeScript `import { UAParser } from 'ua-parser-js'`
- Provided Enums submodule `'ua-parser-js/enums'`
- Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'`:
- `getDeviceVendor()` to guess for a device vendor based on its model name
- `isAppleSilicon()` to check if the device has Apple Silicon Mac device properties
- `isBot()` to check if the browser is identified as a bot
- `isChromeFamily()` to check if the browser is Chrome-based / has Blink engine (i.e: New Opera, New Edge, Vivaldi, Brave, Arc, etc.)
- `isElectron()` to check if current window is running inside Electron
- `isFromEU()` to check if current window is from an EU (European Union) country
- `isFrozenUA()` to check if a user-agent string match with the reduced/frozen user-agent pattern
- `isStandalonePWA()` to check if current window is a standalone PWA

--

## Version 2.0.0-rc.2

- Fix incorrect import path in ESM files
- Add new browser: 115, SlimBoat, Slimjet, LibreWolf
- Improve browser detection: 2345, 360, Dragon, Iron, Maxthon
- `ua-parser-js/enums` submodule:
- Add Chromecast OS variants: Android/Fuchsia/Linux/SmartSpeaker
- `ua-parser-js/helpers` submodule:
- Add new method: `isBot()` to check if the browser is identified as a bot

## Version 2.0.0-rc.1

- Fix Python Request mistakenly identified as Meta Quest
Expand Down Expand Up @@ -68,27 +109,6 @@

- Initial work on new major version

## Version 2.0

- What's breaking:
- Dual-licensed under AGPLv3 or PRO License
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- AR/VR devices moved to new device type: `xr`
- New property in `browser`: `type`
- What's new:
- Some new methods in result object:
- Support for client hints: `withClientHints()`
- Support for feature detection: `withFeatureCheck()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Parse directly from command line using `npx ua-parser-js`
- Extensions can be passed as a list to `UAParser()`
- Support for ES module `import { UAParser } from 'ua-parser-js'`
- Provided Enums submodule `'ua-parser-js/enums'`
- Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'`

---

## Version 0.7.38 / 1.0.38
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.

46 changes: 43 additions & 3 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.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-rc.1",
"version": "2.0.0-rc.2",
"author": "Faisal Salman <[email protected]> (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-rc.1
/* Enums for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
Expand Down
16 changes: 12 additions & 4 deletions 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-rc.1
/* Enums for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
Expand All @@ -12,8 +12,9 @@
/*jshint esversion: 6 */

const Browser = Object.freeze({
'2345_EXPLORER': '2345Explorer',
'360': '360 Browser',
'115': '115',
'2345': '2345',
'360': '360',
ALIPAY: 'Alipay',
AMAYA: 'Amaya',
ANDROID: 'Android Browser',
Expand All @@ -36,11 +37,11 @@ const Browser = Object.freeze({
CHROMIUM: 'Chromium',
COBALT: 'Cobalt',
COC_COC: 'Coc Coc',
COMODO_DRAGON: 'Comodo Dragon',
CONKEROR: 'Conkeror',
DILLO: 'Dillo',
DOLPHIN: 'Dolphin',
DORIS: 'Doris',
DRAGON: 'Dragon',
DUCKDUCKGO: 'DuckDuckGo',
EDGE: 'Edge',
EPIPHANY: 'Epiphany',
Expand Down Expand Up @@ -78,6 +79,7 @@ const Browser = Object.freeze({
KLARNA: 'Klarna',
KINDLE: 'Kindle',
LENOVO: 'Smart Lenovo Browser',
LIBREWOLF: 'LibreWolf',
LIEBAO: 'LBBROWSER',
LINE: 'Line',
LINKEDIN: 'LinkedIn',
Expand Down Expand Up @@ -126,7 +128,9 @@ const Browser = Object.freeze({
SILK: 'Silk',
SKYFIRE: 'Skyfire',
SLEIPNIR: 'Sleipnir',
SLIMBOAT: 'SlimBoat',
SLIMBROWSER: 'SlimBrowser',
SLIMJET: 'Slimjet',
SNAPCHAT: 'Snapchat',
SOGOU_EXPLORER: 'Sogou Explorer',
SOGOU_MOBILE: 'Sogou Mobile',
Expand Down Expand Up @@ -291,6 +295,10 @@ const OS = Object.freeze({
CENTOS: 'CentOS',
CHROME_OS: 'Chrome OS',
CHROMECAST: 'Chromecast',
CHROMECAST_ANDROID: 'Chromecast Android',
CHROMECAST_FUCHSIA: 'Chromecast Fuchsia',
CHROMECAST_LINUX: 'Chromecast Linux',
CHROMECAST_SMARTSPEAKER: 'Chromecast SmartSpeaker',
CONTIKI: 'Contiki',
DEBIAN: 'Debian',
DEEPIN: 'Deepin',
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/ua-parser-extensions.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.2
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>

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-rc.1
/* Extensions for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
Expand Down
2 changes: 1 addition & 1 deletion 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-rc.1
/* Extensions for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/ua-parser-helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.2
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>

Expand Down
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-rc.1
/* Helpers for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
Expand Down
23 changes: 8 additions & 15 deletions src/helpers/ua-parser-helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
// Source: /src/helpers/ua-parser-helpers.js

///////////////////////////////////////////////
/* Helpers for UAParser.js v2.0.0-rc.1
/* Helpers for UAParser.js v2.0.0-rc.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
AGPLv3 License */
//////////////////////////////////////////////

/*jshint esversion: 6 */

import { CPU, OS, Engine } from './enums/ua-parser-enums.mjs';
import { UAParser } from './main/ua-parser.mjs';
import { UAParser } from '../main/ua-parser.mjs';
import { CPU, OS, Engine } from '../enums/ua-parser-enums.mjs';
import { isFromEU } from 'detect-europe-js';
import { isFrozenUA } from 'ua-is-frozen';
import { isStandalonePWA } from 'is-standalone-pwa';

const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor;

Expand All @@ -37,26 +39,17 @@ const isAppleSilicon = (res) => {
return false;
}

const isBot = (res) => ['cli', 'crawler', 'fetcher', 'module'].includes(res.browser.type);

const isChromeFamily = (res) => res.engine.is(Engine.BLINK);

const isElectron = () => !!(process?.versions?.hasOwnProperty('electron') || // node.js
/ electron\//i.test(navigator?.userAgent)); // browser

const isFrozenUA = (ua) => /^Mozilla\/5\.0 \((Windows NT 10\.0; Win64; x64|Macintosh; Intel Mac OS X 10_15_7|X11; Linux x86_64|X11; CrOS x86_64 14541\.0\.0|Fuchsia|Linux; Android 10; K)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/\d+\.0\.0\.0 (Mobile )?Safari\/537\.36/.test(ua);

const isStandalonePWA = () => window && (window.matchMedia('(display-mode: standalone)').matches ||
// iOS
navigator.standalone ||
// Android
document.referrer.startsWith('android-app://') ||
// Windows
window.Windows ||
/trident.+(msapphost|webview)\//i.test(navigator.userAgent) ||
document.referrer.startsWith('app-info://platform/microsoft-store'));

export {
getDeviceVendor,
isAppleSilicon,
isBot,
isChromeFamily,
isElectron,
isFromEU,
Expand Down
2 changes: 1 addition & 1 deletion src/main/ua-parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for UAParser.js v2.0.0-beta.3
// Type definitions for UAParser.js v2.0.0-rc.2
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>

Expand Down
4 changes: 2 additions & 2 deletions src/main/ua-parser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v2.0.0-rc.1
/* UAParser.js v2.0.0-rc.2
Copyright © 2012-2024 Faisal Salman <[email protected]>
AGPLv3 License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Expand All @@ -19,7 +19,7 @@
// Constants
/////////////

var LIBVERSION = '2.0.0-rc.1',
var LIBVERSION = '2.0.0-rc.2',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down
Loading

0 comments on commit a1644b6

Please sign in to comment.