diff --git a/index.html b/index.html index b1c2905..3efeee3 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,7 @@ + @@ -38,10 +39,9 @@ in browser (client-side) or node.js (server-side).

- Try The Demo -
- Read The - Docs + Try Demo + Download + Read Docs
@@ -82,7 +82,7 @@

- {UAParser.js} will transforms it into a well-structured format:

+ In addition with some browser-supplied data, {UAParser.js} will transforms it into a well-structured format:

@@ -232,13 +232,13 @@
Relatively Small Footprint
-

{UAParser.js} is optimized to be used within browser. +

{UAParser.js} starts from and is optimized to be used within browser. While it covers a vast range of detection, the size always kept to be as light as possible.

For extra cache performance, {UAParser.js} also - available in popular CDN services: jsDelivr / jsDelivr / CDNJS

@@ -250,8 +250,8 @@ Zero-deps Vanilla JS -

No bloated framework. No transpiler required. No unnecessary boilerplate. No - dependencies.

+

No + dependencies. No bloated framework. No transpiler needed. No unnecessary boilerplate. No large-sized files required.

Just a good ol' ES3-compatible syntax that is able to run on relatively old browsers while also performs on most modern devices.

@@ -267,13 +267,13 @@ 100% Free & Open Source -

Licensed under an extremely permissive MIT license, - {UAParser.js} is free to use & modify at no charge.

-

Contribute back either by submitting a Licensed under open-source terms, + {UAParser.js} is free to use & modify at no charge. PRO licenses also available for non-open-source purpose.

+

Contribute back in form of a PR or consider to PR, or donate if you find it - helpful for your business or company.

+ helpful for your business.

@@ -289,7 +289,7 @@

Also, for TypeScript user, there is a community-maintained types: @types/ua-parser-js

+ class="ui code">@types/ua-parser-js

@@ -1025,10 +1025,196 @@
+
+ DOWNLOADS : CHOOSE YOUR PACKAGE +
+
+
+

Package Options
Comparison between our regular open-source & PRO licenses
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Version 1.0Version 2.0
LicenseMITAGPLv3PRO PersonalPRO BusinessPRO Enterprise
Browser detection
CPU detection
Device detection
Engine detection
OS detection
Enhanced detection
Client Hints support
Extras (Apps, Bots, Libs, Emails, Media Players, etc)
CommonJS support
ES modules support
npm module available
TypeScript declarations available
Allowed for commercial use
Permissive license
Unlimited use per 1 license
1-year support
Lifetime updates
PriceFREEFREE$12$25$500
+ GET THE PACKAGE +
+
+
CONTRIBUTORS : SUPPORTED BY THE AMAZING OPEN-SOURCE COMMUNITIES
-
+
+
+

Contributors
Those who collaborate and + continuosly improve this library to be awesome
+

+ +

Backers & Sponsors
Those who give back and get the value from using this library
@@ -1042,24 +1228,17 @@

Contribute to UAParser.js
It's free to use, but - feel free to contribute if you find it useful
+ feel free to contribute if you find it helpful

+ class="ui labeled icon black button"> ONE-TIME SPONSOR + class="ui labeled icon black button"> MONTHLY SPONSOR GITHUB SPONSOR
-
-

Contributors
Those who collaborate and - continuosly improve this library to be awesome
-

- -
@@ -1102,7 +1281,7 @@
-

Licensed under MIT license. Copyright (c) 2012-2023 Faisal Salman.

+

Licensed under AGPLv3 license. Copyright (c) 2012-2023 Faisal Salman.

diff --git a/js/ua-parser.js b/js/ua-parser.js index bc8c73a..8013a06 100644 --- a/js/ua-parser.js +++ b/js/ua-parser.js @@ -1,4 +1,4 @@ -/* UAParser.js v2.0.0-alpha.2 +/* UAParser.js v2.0.0-beta.1 Copyright © 2012-2023 Faisal Salman - MIT License */ - (function(window,undefined){"use strict";var LIBVERSION="2.0.0-alpha.2",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",USER_AGENT="user-agent",UA_MAX_LENGTH=350,BRANDS="brands",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-bitness",CH_HEADER_MOBILE=CH_HEADER+"-mobile",CH_HEADER_MODEL=CH_HEADER+"-model",CH_HEADER_PLATFORM=CH_HEADER+"-platform",CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=["brands","fullVersionList",MOBILE,MODEL,"platform","platformVersion",ARCHITECTURE,"bitness"],UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",WINDOWS="Windows";var NAVIGATOR=typeof window!==UNDEF_TYPE&&window.navigator?window.navigator:undefined,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:undefined;var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){mergedRegexes[i]=extensions[i]&&extensions[i].length%2===0?extensions[i].concat(regexes[i]):regexes[i]}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i0){for(var i in str1){if(lowerize(str1[i])==lowerize(str2))return true}return false}return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:false},isExtensions=function(obj){for(var prop in obj){return/^(browser|cpu|device|engine|os)$/.test(prop)}},itemListToArray=function(header){if(!header)return undefined;var arr=[];var tokens=strip(/\\?\"/g,header).split(", ");for(var i=0;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}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j2){this.set(MODEL,"iPad").set(TYPE,TABLET)}break;case UA_OS:if(!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]){this.set(NAME,NAVIGATOR_UADATA[PLATFORM])}break;case UA_RESULT:var data=this.data;var detect=function(itemType){return data[itemType].getItem().detectFeature().get()};this.set(UA_BROWSER,detect(UA_BROWSER)).set(UA_CPU,detect(UA_CPU)).set(UA_DEVICE,detect(UA_DEVICE)).set(UA_ENGINE,detect(UA_ENGINE)).set(UA_OS,detect(UA_OS))}}return this};this.parseUA=function(){if(this.itemType!=UA_RESULT){rgxMapper.call(this.data,this.ua,this.rgxMap)}if(this.itemType==UA_BROWSER){this.set(MAJOR,majorize(this.get(VERSION)))}return this};this.parseCH=function(){var ua=this.ua,uaCH=this.uaCH,rgxMap=this.rgxMap;switch(this.itemType){case UA_BROWSER:var brands=uaCH[FULLVERLIST]||uaCH[BRANDS];if(brands){for(var i in brands){var brandName=brands[i].brand,brandVersion=brands[i].version;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))}}}break;case UA_CPU:var archName=uaCH[ARCHITECTURE];if(archName){if(archName&&uaCH[BITNESS]=="64")archName+="64";rgxMapper.call(this.data,archName+";",rgxMap)}break;case UA_DEVICE:if(uaCH[MOBILE]){this.set(TYPE,MOBILE)}if(uaCH[MODEL]){this.set(MODEL,uaCH[MODEL])}break;case UA_OS:var osName=uaCH[PLATFORM];if(osName){var osVersion=uaCH[PLATFORMVER];if(osName==WINDOWS)osVersion=parseInt(majorize(osVersion),10)>=13?"11":"10";this.set(NAME,osName).set(VERSION,osVersion)}break;case UA_RESULT:var data=this.data;var parse=function(itemType){return data[itemType].getItem().setCH(uaCH).parseCH().get()};this.set(UA_BROWSER,parse(UA_BROWSER)).set(UA_CPU,parse(UA_CPU)).set(UA_DEVICE,parse(UA_DEVICE)).set(UA_ENGINE,parse(UA_ENGINE)).set(UA_OS,parse(UA_OS))}return this};setProps.call(this,[["itemType",itemType],["ua",ua],["uaCH",uaCH],["rgxMap",rgxMap],["data",createIData(this,itemType)]]);return this}function UAParser(ua,extensions,headers){if(typeof ua===OBJ_TYPE){if(isExtensions(ua)){if(typeof extensions===OBJ_TYPE){headers=extensions}extensions=ua}else{headers=ua;extensions=undefined}ua=undefined}else if(typeof ua===STR_TYPE&&!isExtensions(extensions)){headers=extensions;extensions=undefined}if(!(this instanceof UAParser)){return new UAParser(ua,extensions,headers).getResult()}var userAgent=ua||(NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:headers&&headers[USER_AGENT]?headers[USER_AGENT]:EMPTY),HTTP_UACH=new UACHData(headers,true),regexMap=extensions?extend(defaultRegexes,extensions):defaultRegexes,createItemFunc=function(itemType){if(itemType==UA_RESULT){return function(){return new UAItem(itemType,userAgent,regexMap,HTTP_UACH).set("ua",userAgent).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}}else{return function(){return new UAItem(itemType,userAgent,regexMap[itemType],HTTP_UACH).parseUA().get()}}};setProps.call(this,[["getBrowser",createItemFunc(UA_BROWSER)],["getCPU",createItemFunc(UA_CPU)],["getDevice",createItemFunc(UA_DEVICE)],["getEngine",createItemFunc(UA_ENGINE)],["getOS",createItemFunc(UA_OS)],["getResult",createItemFunc(UA_RESULT)],["getUA",function(){return userAgent}],["setUA",function(ua){userAgent=typeof ua===STR_TYPE&&ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this}]]).setUA(userAgent);return this}UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define===FUNC_TYPE&&define.amd){define(function(){return UAParser})}else if(typeof window!==UNDEF_TYPE){window.UAParser=UAParser}}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file + AGPLv3 License */ +!function(i,c){"use strict";function e(i){for(var e={},t=0;t_?yi(i,_):i),this}]]).setUA(o),this}Pi.VERSION="2.0.0-beta.1",Pi.BROWSER=e([f,g,p]),Pi.CPU=e([v]),Pi.DEVICE=e([h,t,m,o,x,a,r,l,k]),Pi.ENGINE=Pi.OS=e([f,g]),typeof exports!==b?(typeof module!==b&&module.exports&&(exports=module.exports=Pi),exports.UAParser=Pi):typeof define===u&&define.amd?define(function(){return Pi}):typeof i!==b&&(i.UAParser=Pi);var Ui,Hi=typeof i!==b&&(i.jQuery||i.Zepto);Hi&&!Hi.ua&&(Ui=new Pi,Hi.ua=Ui.getResult(),Hi.ua.get=function(){return Ui.getUA()},Hi.ua.set=function(i){Ui.setUA(i);var e,t=Ui.getResult();for(e in t)Hi.ua[e]=t[e]})}("object"==typeof window?window:this); \ No newline at end of file