Bump version 2.0.0-alpha.2

This commit is contained in:
Faisal Salman 2023-04-02 17:55:18 +07:00
parent 359cbecd32
commit 5d2acd8fe7
12 changed files with 62 additions and 37 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "2.0.0-alpha.1", "version": "2.0.0-alpha.2",
"authors": [ "authors": [
"Faisal Salman <f@faisalman.com>" "Faisal Salman <f@faisalman.com>"
], ],

View File

@ -1,16 +1,32 @@
# UAParser.js Changelog # UAParser.js Changelog
# Version 2.0.0-alpha.1 # Version 2.0
- Breaking changes: - What's breaking:
- Browser detection on mobile device: `Chrome => Mobile Chrome`, `Firefox => Mobile Firefox` - Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `Mac OS => macOS`, `Chromium OS => Chrome OS` - OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- Add some new methods in result object: - What's new:
- Add some new methods in result object:
- Add support for client hints: `withClientHints()` - Add support for client hints: `withClientHints()`
- Utility for easy comparison: `is()` - Utility for easy comparison: `is()`
- Utility to print full-name: `toString()` - Utility to print full-name: `toString()`
- Add support for ES module `import { UAParser } from 'ua-parser-js'` - Add support for ES module `import { UAParser } from 'ua-parser-js'`
- Provide Enums `'ua-parser-js/enums'` - Provide Enums `'ua-parser-js/enums'`
- Provide Extensions `'ua-parser-js/extensions'` - 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 browser: Heytap, TikTok
- Add new engine: LibWeb - Add new engine: LibWeb
- Add new OS: SerenityOS - Add new OS: SerenityOS
@ -18,10 +34,6 @@
- Improve device detection: iPhone, Amazon Echo - Improve device detection: iPhone, Amazon Echo
- Improve OS detection: iOS - 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 ## Version 0.7.34 / 1.0.34
- Fix Sharp Mobile detected as Huawei Tablet - Fix Sharp Mobile detected as Huawei Tablet
- Fix IE8 bug - Fix IE8 bug

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
Package.describe({ Package.describe({
name: 'faisalman:ua-parser-js', 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', summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git', git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md' documentation: 'readme.md'

View File

@ -1,7 +1,7 @@
{ {
"title": "UAParser.js", "title": "UAParser.js",
"name": "ua-parser-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)", "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", "description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [ "keywords": [

View File

@ -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 https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
MIT License */ MIT License */

View File

@ -3,7 +3,7 @@
// Source: /src/enum/ua-parser-enum.js // 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 https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
MIT License */ MIT License */

View File

@ -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 https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
MIT License */ MIT License */

View File

@ -3,7 +3,7 @@
// Source: /src/extension/ua-parser-extension.js // 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 https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
MIT License */ MIT License */

View File

@ -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> Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
MIT License *//* MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
@ -17,7 +17,7 @@
///////////// /////////////
var LIBVERSION = '2.0.0-alpha.1', var LIBVERSION = '2.0.0-alpha.2',
EMPTY = '', EMPTY = '',
UNKNOWN = '?', UNKNOWN = '?',
FUNC_TYPE = 'function', FUNC_TYPE = 'function',
@ -332,7 +332,7 @@
/miuibrowser\/([\w\.]+)/i // MIUI Browser /miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [ ], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [
/fxios\/([\w\.-]+)/i // Firefox for iOS /fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, PREFIX_MOBILE + 'Firefox']], [ ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360 /\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [ ], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i /(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
@ -391,7 +391,7 @@
// Gecko based // Gecko based
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile /(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile
], [[NAME, PREFIX_MOBILE + 'Firefox'], VERSION], [ ], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [ ], [[NAME, 'Netscape'], VERSION], [
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality

View File

@ -5,7 +5,7 @@
const window = undefined; 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> Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
MIT License *//* MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
@ -21,7 +21,7 @@ const window = undefined;
///////////// /////////////
var LIBVERSION = '2.0.0-alpha.1', var LIBVERSION = '2.0.0-alpha.2',
EMPTY = '', EMPTY = '',
UNKNOWN = '?', UNKNOWN = '?',
FUNC_TYPE = 'function', FUNC_TYPE = 'function',
@ -336,7 +336,7 @@ const window = undefined;
/miuibrowser\/([\w\.]+)/i // MIUI Browser /miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [ ], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [
/fxios\/([\w\.-]+)/i // Firefox for iOS /fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, PREFIX_MOBILE + 'Firefox']], [ ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360 /\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [ ], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i /(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
@ -395,7 +395,7 @@ const window = undefined;
// Gecko based // Gecko based
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile /(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile
], [[NAME, PREFIX_MOBILE + 'Firefox'], VERSION], [ ], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [ ], [[NAME, 'Netscape'], VERSION], [
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
@ -892,8 +892,21 @@ const window = undefined;
if (!NAVIGATOR_UADATA) { if (!NAVIGATOR_UADATA) {
UAParserData.prototype.then = function (cb) { UAParserData.prototype.then = function (cb) {
cb(this); var that = this;
return 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;
}; };
} }
@ -996,7 +1009,7 @@ const window = undefined;
for (var i in brands) { for (var i in brands) {
var brandName = brands[i].brand, var brandName = brands[i].brand,
brandVersion = brands[i].version; 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)) this.set(NAME, strip(GOOGLE+' ', brandName))
.set(VERSION, brandVersion) .set(VERSION, brandVersion)
.set(MAJOR, majorize(brandVersion)); .set(MAJOR, majorize(brandVersion));