Skip to content

Commit

Permalink
Bump version 2.0.0-alpha.2
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Apr 2, 2023
1 parent 359cbec commit 5d2acd8
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
Expand Down
42 changes: 27 additions & 15 deletions changelog.md
@@ -1,27 +1,39 @@
# UAParser.js Changelog

# Version 2.0.0-alpha.1
- Breaking changes:
- Browser detection on mobile device: `Chrome => Mobile Chrome`, `Firefox => Mobile Firefox`
- OS detection: `Mac OS => macOS`, `Chromium OS => Chrome OS`
- Add some new methods in result object:
- Add support for client hints: `withClientHints()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Add support for ES module `import { UAParser } from 'ua-parser-js'`
- Provide Enums `'ua-parser-js/enums'`
- Provide Extensions `'ua-parser-js/extensions'`
# Version 2.0
- What's breaking:
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- What's new:
- Add some new methods in result object:
- Add support for client hints: `withClientHints()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Add support for ES module `import { UAParser } from 'ua-parser-js'`
- Provide Enums `'ua-parser-js/enums'`
- Provide Extensions `'ua-parser-js/extensions'`

## Version 2.0.0-alpha.2
- Fix browser result always returning Chromium when using `withClientHints()`
- Fix infinite-loop when await-ing `withClientHints()` in non-client-hints browser

## Version 2.0.0-alpha.1
- Initial work on new major version


# Version 0.7 / 1.0

Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.

## Version 0.7.35 / 1.0.35
- Fix result from user-supplied user-agent being altered
- Add new browser: Heytap, TikTok
- Add new engine: LibWeb
- Add new OS: SerenityOS
- Improve browser detection: Yandex
- Improve device detection: iPhone, Amazon Echo
- Improve OS detection: iOS

# Version 0.7 / 1.0

Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.

## Version 0.7.34 / 1.0.34
- Fix Sharp Mobile detected as Huawei Tablet
- Fix IE8 bug
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.

2 changes: 1 addition & 1 deletion package.js
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '2.0.0-alpha.1',
version: '2.0.0-alpha.2',
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
@@ -1,7 +1,7 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/enum/ua-parser-enum.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-alpha.1
/* Enums for UAParser.js v2.0.0-alpha.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
2 changes: 1 addition & 1 deletion src/enum/ua-parser-enum.mjs
Expand Up @@ -3,7 +3,7 @@
// Source: /src/enum/ua-parser-enum.js

///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-alpha.1
/* Enums for UAParser.js v2.0.0-alpha.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
2 changes: 1 addition & 1 deletion src/extension/ua-parser-extension.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-alpha.1
/* Extensions for UAParser.js v2.0.0-alpha.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
2 changes: 1 addition & 1 deletion src/extension/ua-parser-extension.mjs
Expand Up @@ -3,7 +3,7 @@
// Source: /src/extension/ua-parser-extension.js

///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-alpha.1
/* Extensions for UAParser.js v2.0.0-alpha.2
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
MIT License */
Expand Down
8 changes: 4 additions & 4 deletions src/ua-parser.js
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v2.0.0-alpha.1
/* UAParser.js v2.0.0-alpha.2
Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Expand All @@ -17,7 +17,7 @@
/////////////


var LIBVERSION = '2.0.0-alpha.1',
var LIBVERSION = '2.0.0-alpha.2',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down Expand Up @@ -332,7 +332,7 @@
/miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, PREFIX_MOBILE + 'Firefox']], [
], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
Expand Down Expand Up @@ -391,7 +391,7 @@

// Gecko based
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile
], [[NAME, PREFIX_MOBILE + 'Firefox'], VERSION], [
], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
Expand Down
27 changes: 20 additions & 7 deletions src/ua-parser.mjs
Expand Up @@ -5,7 +5,7 @@
const window = undefined;

/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v2.0.0-alpha.1
/* UAParser.js v2.0.0-alpha.2
Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Expand All @@ -21,7 +21,7 @@ const window = undefined;
/////////////


var LIBVERSION = '2.0.0-alpha.1',
var LIBVERSION = '2.0.0-alpha.2',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down Expand Up @@ -336,7 +336,7 @@ const window = undefined;
/miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, PREFIX_MOBILE + 'Firefox']], [
], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
Expand Down Expand Up @@ -395,7 +395,7 @@ const window = undefined;

// Gecko based
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile
], [[NAME, PREFIX_MOBILE + 'Firefox'], VERSION], [
], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
Expand Down Expand Up @@ -892,8 +892,21 @@ const window = undefined;

if (!NAVIGATOR_UADATA) {
UAParserData.prototype.then = function (cb) {
cb(this);
return this;
var that = this;
var UAParserDataResolve = function () {
for (var prop in that) {
if (that.hasOwnProperty(prop)) {
this[prop] = that[prop];
}
}
};
UAParserDataResolve.prototype = {
is : UAParserData.prototype.is,
toString : UAParserData.prototype.toString
};
var resolveData = new UAParserDataResolve();
cb(resolveData);
return resolveData;
};
}

Expand Down Expand Up @@ -996,7 +1009,7 @@ const window = undefined;
for (var i in brands) {
var brandName = brands[i].brand,
brandVersion = brands[i].version;
if (!/not.a.brand/i.test(brandName) || /chromi/i.test(this.get(NAME))) {
if (!/not.a.brand/i.test(brandName) && (i < 1 || /chromi/i.test(this.get(NAME)))) {
this.set(NAME, strip(GOOGLE+' ', brandName))
.set(VERSION, brandVersion)
.set(MAJOR, majorize(brandVersion));
Expand Down

0 comments on commit 5d2acd8

Please sign in to comment.