diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..3ec50a0bb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: ua-parser-js +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://www.paypal.me/faisalman/'] diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml new file mode 100644 index 000000000..ab126d2a6 --- /dev/null +++ b/.github/workflows/run-test.yml @@ -0,0 +1,17 @@ +name: ua-parser-js-run-test + +on: [push, pull_request] + +jobs: + run-test: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, ppc64le] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Run the test + run: | + npm install + npm run test-ci diff --git a/.gitignore b/.gitignore index 154d1f06e..ca8c34e70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules/ npm-debug.log + ### vim ### .*.s[a-w][a-z] *.un~ @@ -8,17 +9,20 @@ Session.vim *~ .versions +### editors ### +.vscode +.idea +*.sublime-* + ### OSX ### .DS_Store .AppleDouble .LSOverride Icon - # Thumbnails ._* # Files that might appear on external disk .Spotlight-V100 .Trashes -.idea diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..43c97e719 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.travis.yml b/.travis.yml index 4d23aa06a..0f87fc37f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ +arch: + - amd64 + - ppc64le language: node_js node_js: - stable - - "0.10" + - lts/* notifications: email: false @@ -11,3 +14,5 @@ cache: - node_modules sudo: false + +script: npm run test-ci \ No newline at end of file diff --git a/bower.json b/bower.json index 9137147ac..6539b1b8e 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ua-parser-js", - "version": "0.7.10", + "version": "0.7.28", "authors": [ - "Faisal Salman " + "Faisal Salman " ], "private": false, "main": "src/ua-parser.js", @@ -13,31 +13,5 @@ "test", "tests" ], - "contributors": [ - "Faisal Salman ", - "Benjamin Bertrand ", - "Carl C Von Lewin ", - "Christopher De Cairos ", - "Davit Barbakadze ", - "Dmitry Tyschenko ", - "Douglas Li ", - "Dumitru Uzun ", - "Erik Hesselink ", - "Fabian Becker ", - "Hendrik Helwich ", - "Jackpoll ", - "Jake Mc ", - "John Tantalo ", - "John Yanarella ", - "Jon Buckley ", - "Kendall Buchanan ", - "Lee Treveil ", - "Leonardo ", - "Max Maurer ", - "Michael Hess ", - "OtakuSiD ", - "Ross Noble ", - "Sandro Sonntag " - ], "dependencies": {} } diff --git a/changelog.md b/changelog.md new file mode 100644 index 000000000..05fc6b90b --- /dev/null +++ b/changelog.md @@ -0,0 +1,3 @@ +# UAParser.js Changelog + +## Version 0.8.0 \ No newline at end of file diff --git a/component.json b/component.json deleted file mode 100644 index 9d405023b..000000000 --- a/component.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "ua-parser-js", - "version": "0.7.10", - "description": "Lightweight JavaScript-based user-agent string parser", - "keywords": [ - "user-agent", - "parser", - "browser", - "engine", - "os", - "device", - "cpu" - ], - "scripts": [ - "src/ua-parser.js" - ], - "main": "src/ua-parser.js", - "license": "MIT", - "development": { - "jshint/jshint": "*", - "visionmedia/mocha": "*", - "mishoo/uglifyjs2": "*" - } -} diff --git a/dist/ua-parser.html b/dist/ua-parser.html new file mode 100644 index 000000000..1e530bb17 --- /dev/null +++ b/dist/ua-parser.html @@ -0,0 +1 @@ + diff --git a/dist/ua-parser.min.js b/dist/ua-parser.min.js index faf7e19b7..9affb6bd2 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -1,8 +1,9 @@ -/** - * UAParser.js v0.7.10 +/*!@license + * UAParser.js v0.7.28 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2015 Faisal Salman - * Dual licensed under GPLv2 & MIT - */(function(e,t){"use strict";var n="0.7.10",r="",i="?",s="function",o="undefined",u="object",a="string",f="major",l="model",c="name",h="type",p="vendor",d="version",v="architecture",m="console",g="mobile",y="tablet",b="smarttv",w="wearable",E="embedded",S={extend:function(e,t){for(var n in t)"browser cpu device engine os".indexOf(n)!==-1&&t[n].length%2===0&&(e[n]=t[n].concat(e[n]));return e},has:function(e,t){return typeof e=="string"?t.toLowerCase().indexOf(e.toLowerCase())!==-1:!1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===a?e.split(".")[0]:t}},x={rgx:function(){var e,n=0,r,i,a,f,l,c,h=arguments;while(n0?f.length==2?typeof f[1]==s?e[f[0]]=f[1].call(this,c):e[f[0]]=f[1]:f.length==3?typeof f[1]===s&&(!f[1].exec||!f[1].test)?e[f[0]]=c?f[1].call(this,c,f[2]):t:e[f[0]]=c?c.replace(f[1],f[2]):t:f.length==4&&(e[f[0]]=c?f[3].call(this,c.replace(f[1],f[2])):t):e[f]=c?c:t}n+=2}return e},str:function(e,n){for(var r in n)if(typeof n[r]===u&&n[r].length>0){for(var s=0;s + * Licensed under MIT License + */ +(function(window,undefined){"use strict";var LIBVERSION="0.7.28",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",UA_MAX_LENGTH=255;var util={extend:function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},has:function(str1,str2){return typeof str1===STR_TYPE?str2.toLowerCase().indexOf(str1.toLowerCase())!==-1:false},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str,len){str=str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(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}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;jUA_MAX_LENGTH?util.trim(ua,UA_MAX_LENGTH):ua;return this};this.setUA(_ua);return this};UAParser.VERSION=LIBVERSION;UAParser.BROWSER={NAME:NAME,MAJOR:MAJOR,VERSION:VERSION};UAParser.CPU={ARCHITECTURE:ARCHITECTURE};UAParser.DEVICE={MODEL:MODEL,VENDOR:VENDOR,TYPE:TYPE,CONSOLE:CONSOLE,MOBILE:MOBILE,SMARTTV:SMARTTV,TABLET:TABLET,WEARABLE:WEARABLE,EMBEDDED:EMBEDDED};UAParser.ENGINE={NAME:NAME,VERSION:VERSION};UAParser.OS={NAME:NAME,VERSION:VERSION};if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define==="function"&&define.amd){define(function(){return UAParser})}else if(typeof window!=="undefined"){window.UAParser=UAParser}}var $=typeof window!=="undefined"&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(uastring){parser.setUA(uastring);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file diff --git a/dist/ua-parser.pack.js b/dist/ua-parser.pack.js index faf7e19b7..08dd52b55 100644 --- a/dist/ua-parser.pack.js +++ b/dist/ua-parser.pack.js @@ -1,8 +1,9 @@ -/** - * UAParser.js v0.7.10 +/*!@license + * UAParser.js v0.7.28 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2015 Faisal Salman - * Dual licensed under GPLv2 & MIT - */(function(e,t){"use strict";var n="0.7.10",r="",i="?",s="function",o="undefined",u="object",a="string",f="major",l="model",c="name",h="type",p="vendor",d="version",v="architecture",m="console",g="mobile",y="tablet",b="smarttv",w="wearable",E="embedded",S={extend:function(e,t){for(var n in t)"browser cpu device engine os".indexOf(n)!==-1&&t[n].length%2===0&&(e[n]=t[n].concat(e[n]));return e},has:function(e,t){return typeof e=="string"?t.toLowerCase().indexOf(e.toLowerCase())!==-1:!1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===a?e.split(".")[0]:t}},x={rgx:function(){var e,n=0,r,i,a,f,l,c,h=arguments;while(n0?f.length==2?typeof f[1]==s?e[f[0]]=f[1].call(this,c):e[f[0]]=f[1]:f.length==3?typeof f[1]===s&&(!f[1].exec||!f[1].test)?e[f[0]]=c?f[1].call(this,c,f[2]):t:e[f[0]]=c?c.replace(f[1],f[2]):t:f.length==4&&(e[f[0]]=c?f[3].call(this,c.replace(f[1],f[2])):t):e[f]=c?c:t}n+=2}return e},str:function(e,n){for(var r in n)if(typeof n[r]===u&&n[r].length>0){for(var s=0;s + * Licensed under MIT License + */ +!function(r,b){"use strict";var u="function",e="undefined",c="object",a="string",i="model",s="name",o="type",n="vendor",t="version",l="architecture",w="console",d="mobile",m="tablet",p="smarttv",f="wearable",h="embedded",g={extend:function(i,s){var e,o={};for(e in i)s[e]&&s[e].length%2==0?o[e]=s[e].concat(i[e]):o[e]=i[e];return o},has:function(i,s){return typeof i==a&&-1!==s.toLowerCase().indexOf(i.toLowerCase())},lowerize:function(i){return i.toLowerCase()},major:function(i){return typeof i==a?i.replace(/[^\d\.]/g,"").split(".")[0]:b},trim:function(i,s){return i=i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof s==e?i:i.substring(0,255)}},v={rgx:function(i,s){for(var e,o,r,a,n,t=0;t> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.js b/package.js index 7dfc1069d..8ff9001ef 100644 --- a/package.js +++ b/package.js @@ -1,11 +1,12 @@ Package.describe({ name: 'faisalman:ua-parser-js', - version: '0.7.10', + version: '0.7.28', summary: 'Lightweight JavaScript-based user-agent string parser', git: 'https://github.com/faisalman/ua-parser-js.git', documentation: 'readme.md' }); -Package.on_use(function (api) { +Package.onUse(function (api) { api.addFiles("src/ua-parser.js"); + api.export("UAParser"); }); diff --git a/package.json b/package.json index fa3f4939a..499b2d1cc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "title": "UAParser.js", "name": "ua-parser-js", - "version": "0.7.10", - "author": "Faisal Salman (http://faisalman.com)", + "version": "0.7.28", + "author": "Faisal Salman (http://faisalman.com)", "description": "Lightweight JavaScript-based user-agent string parser", "keywords": [ "user-agent", @@ -11,46 +11,145 @@ "engine", "os", "device", - "cpu" + "cpu", + "jquery-plugin", + "ecosystem:jquery" ], - "homepage": "http://github.com/faisalman/ua-parser-js", + "homepage": "https://github.com/faisalman/ua-parser-js", "contributors": [ - "Faisal Salman ", + "Aamir Poonawalla ", + "Admas ", + "algenon ", + "Alvin Portillo ", + "Amumu ", + "Andrea Vaghi ", + "Anton Zhiyanov ", + "Arturo Mejia ", + "Arun Rama Reddy ", + "Austin Pray ", + "Bendeguz ", "Benjamin Bertrand ", + "Benjamin Urban ", + "boneyao ", "Carl C Von Lewin ", + "CESAR RAMOS ", + "Chad Killingsworth ", "Christopher De Cairos ", + "Cyrille David ", + "Dario Vladovic ", + "David Annez ", "Davit Barbakadze ", + "ddivernois ", + "Deliaz ", + "Demis Palma ", + "dhoko ", + "dianhe ", + "dineshks1 ", "Dmitry Tyschenko ", "Douglas Li ", "Dumitru Uzun ", + "Dustin ", + "Elchin Valiyev ", + "Emil Hesslow ", + "Eric Redon ", + "Eric Schrenker ", "Erik Hesselink ", "Fabian Becker ", + "Faisal Salman ", + "Frédéric Camblor ", + "Frederik Ring ", + "Gerald Host ", + "Germán M. Bravo ", + "Grigory Dmitrenko ", + "gulpin ", "Hendrik Helwich ", - "Jackpoll ", + "Hermann Ebert ", + "hr6r ", + "Igor Topal ", + "Ildar Kamalov ", + "insanehong ", + "jackpoll ", "Jake Mc ", + "JBYoshi <12983479+JBYoshi@users.noreply.github.com>", + "Joey Parrish ", "John Tantalo ", "John Yanarella ", "Jon Buckley ", + "Josh Goldberg ", + "Junki-Ishida ", "Kendall Buchanan ", "Lee Treveil ", - "Leonardo ", + "leonardo ", + "Levente Balogh ", + "Liam Quinn ", + "Lithin ", + "ll-syber <670159357@qq.com>", + "Loris Guignard ", + "Lukas Drgon ", + "Lukas Eipert ", + "Malash ", + "Martynas ", + "Masahiko Sato ", + "Matt Brophy ", + "Matthew Origer ", + "Maximilian Haupt ", "Max Maurer ", + "Max Nordlund ", "Michael Hess ", - "OtakuSiD ", + "MimyyK ", + "naoh ", + "Nicholas Ionata ", + "Nikhil Motiani ", + "Nik Rolls ", + "nionata ", + "niris ", + "Nobuo Okada ", + "o.drapeza ", + "otakuSiD ", + "patrick-nurt ", + "Pavel Studeny ", + "Peter Dave Hello ", + "philippsimon ", + "Pieter Hendrickx ", + "Piper Chester ", + "Queen Vinyl Darkscratch ", + "Raine Makelainen ", + "Raman Savaryn ", + "Robert Tod ", + "roman.savarin ", + "Ron Korland ", "Ross Noble ", - "Sandro Sonntag " + "ruicong <466403866@qq.com>", + "Sandro Sonntag ", + "sgautrea ", + "Shane Gautreau ", + "Shane Thacker ", + "Shreedhar ", + "Simon Eisenmann ", + "Simon Lang ", + "Stiekel ", + "sUP ", + "Sylvain Gizard ", + "szchenghuang ", + "Tanguy Krotoff ", + "Tony Tomarchio ", + "Ulrich Schmidt ", + "Vadim Kurachevsky ", + "Yılmaz ", + "yuanyang ", + "Yun Young-jin ", + "Zach Bjornson " ], "main": "src/ua-parser.js", "scripts": { - "build": "uglifyjs src/ua-parser.js > dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js > dist/ua-parser.pack.js --comments '/UAParser\\.js/' --compress --mangle", + "build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments --compress --mangle", "test": "jshint src/ua-parser.js && mocha -R nyan test/test.js", + "test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js", "verup": "node ./node_modules/verup", "version": "node ./node_modules/verup 0" }, "verup": { "files": [ - "ua-parser-js.jquery.json", - "component.json", "bower.json", "package.js", "src/ua-parser.js" @@ -61,25 +160,18 @@ ] }, "devDependencies": { - "jshint": "~1.1.0", - "mocha": "~1.8.0", - "uglify-js": "~1.3.4", + "jshint": "~2.12.0", + "mocha": "~8.2.0", + "requirejs": "^2.3.2", + "safe-regex": "^2.1.1", + "uglify-js": "~3.12.0", "verup": "^1.3.x" }, "repository": { "type": "git", "url": "https://github.com/faisalman/ua-parser-js.git" }, - "licenses": [ - { - "type": "GPLv2", - "url": "http://www.gnu.org/licenses/gpl-2.0.html" - }, - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ], + "license": "MIT", "engines": { "node": "*" }, @@ -87,5 +179,18 @@ "dist": "dist", "src": "src", "test": "test" - } + }, + "bugs": "https://github.com/faisalman/ua-parser-js/issues", + "demo": "https://faisalman.github.io/ua-parser-js", + "download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ] } diff --git a/readme.md b/readme.md index e51276eef..30871ebfa 100644 --- a/readme.md +++ b/readme.md @@ -1,51 +1,71 @@ -# UAParser.js +

+ +

+ +

+ + + + + +

-Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as jQuery/Zepto plugin, Component/Bower/Meteor package, & RequireJS/AMD module +# UAParser.js -[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master)](https://travis-ci.org/faisalman/ua-parser-js) -[![Flattr this](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/3867907/faisalmanua-parser-js-on-GitHub) +JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data with relatively small footprint (~17KB minified, ~6KB gzipped) that can be used either in browser (client-side) or node.js (server-side). -* Author : Faisal Salman <> +* Author : Faisal Salman <> * Demo : http://faisalman.github.io/ua-parser-js * Source : https://github.com/faisalman/ua-parser-js -## Features +# Documentation + +## Constructor -Extract detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model purely from user-agent string with relatively lightweight footprint (~11KB minified / ~4KB gzipped). Written in vanilla js, which means it doesn't depends on any other library. +* `new UAParser([uastring][,extensions])` + * returns new instance -![It's over 9000](https://pbs.twimg.com/media/A9LpEG6CIAA5VrT.jpg) +* `UAParser([uastring][,extensions])` + * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` ## Methods * `getBrowser()` * returns `{ name: '', version: '' }` -``` +```sh # Possible 'browser.name': -Amaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Camino, Chimera, Chrome, -Chromium, Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Edge, Epiphany, Fennec, -Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDragon, -Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links, -Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari, -Mosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], -PhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser, -Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, Yandex +2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG, +BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera, +Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, +Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird, +Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, +IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, +Kindle, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser, +Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, +Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser, +OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, +Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, +Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, +SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, Vivaldi, Waterfox, WeChat, +Weibo, Yandex, baidu, iCab, w3m, Whale Browser... # 'browser.version' determined dynamically ``` * `getDevice()` - * returns `{ model: '', type: '', vendor: '' }` + * returns `{ model: '', type: '', vendor: '' }` -``` +```sh # Possible 'device.type': console, mobile, tablet, smarttv, wearable, embedded # Possible 'device.vendor': -Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone, -Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian, -Nintendo, Nokia, Nvidia, Ouya, Palm, Panasonic, Polytron, RIM, Samsung, Sharp, -Siemens, Sony-Ericsson, Sprint, Xbox, ZTE +Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell, +Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, +Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya, +Palm, Panasonic, Pebble, Polytron, Realme, RIM, Samsung, Sharp, Siemens, +Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ... # 'device.model' determined dynamically ``` @@ -53,10 +73,10 @@ Siemens, Sony-Ericsson, Sprint, Xbox, ZTE * `getEngine()` * returns `{ name: '', version: '' }` -``` +```sh # Possible 'engine.name' -Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, -Tasman, Trident, w3m, WebKit +Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, +NetSurf, Presto, Tasman, Trident, w3m, WebKit # 'engine.version' determined dynamically ``` @@ -64,14 +84,15 @@ Tasman, Trident, w3m, WebKit * `getOS()` * returns `{ name: '', version: '' }` -``` +```sh # Possible 'os.name' -AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki, -Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS, -Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD, -Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat, -RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, -Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk +AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, +Contiki, Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU, +Haiku, Hurd, iOS, Joli, KaiOS, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, +Minix, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, +PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS, RISC OS, +Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix, +VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ... # 'os.version' determined dynamically ``` @@ -79,10 +100,9 @@ Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk * `getCPU()` * returns `{ architecture: '' }` -``` +```sh # Possible 'cpu.architecture' -68k, amd64, arm, arm64, avr, ia32, ia64, irix, irix64, mips, mips64, pa-risc, -ppc, sparc, sparc64 +68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] ``` * `getResult()` @@ -92,28 +112,30 @@ ppc, sparc, sparc64 * returns UA string of current instance * `setUA(uastring)` - * set & parse UA string + * set UA string to be parsed + * returns current instance + +# Usage -## Example +## Using HTML ```html - - +