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 9ef0a380a..6539b1b8e 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ua-parser-js", - "version": "0.7.14", + "version": "0.7.28", "authors": [ - "Faisal Salman " + "Faisal Salman " ], "private": false, "main": "src/ua-parser.js", 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/dist/ua-parser.min.js b/dist/ua-parser.min.js index f1de7bc11..9affb6bd2 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -1,9 +1,9 @@ -/** - * UAParser.js v0.7.14 +/*!@license + * UAParser.js v0.7.28 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2016 Faisal Salman - * Dual licensed under GPLv2 & MIT + * Copyright © 2012-2021 Faisal Salman + * Licensed under MIT License */ -(function(window,undefined){"use strict";var LIBVERSION="0.7.14",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";var util={extend:function(regexes,extensions){var margedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){margedRegexes[i]=extensions[i].concat(regexes[i])}else{margedRegexes[i]=regexes[i]}}return margedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return 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){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};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;j0){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 816073142..08dd52b55 100644 --- a/dist/ua-parser.pack.js +++ b/dist/ua-parser.pack.js @@ -1,9 +1,9 @@ -/** - * UAParser.js v0.7.14 +/*!@license + * UAParser.js v0.7.28 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * - * Copyright © 2012-2016 Faisal Salman - * Dual licensed under GPLv2 & MIT + * Copyright © 2012-2021 Faisal Salman + * Licensed under MIT License */ -!function(i,s){"use strict";var e="0.7.14",o="",r="?",n="function",a="undefined",t="object",d="string",l="major",w="model",u="name",c="type",m="vendor",p="version",b="architecture",g="console",f="mobile",h="tablet",v="smarttv",x="wearable",k="embedded",y={extend:function(i,s){var e={};for(var o in i)s[o]&&s[o].length%2===0?e[o]=s[o].concat(i[o]):e[o]=i[o];return e},has:function(i,s){return"string"==typeof i&&s.toLowerCase().indexOf(i.toLowerCase())!==-1},lowerize:function(i){return i.toLowerCase()},major:function(i){return typeof i===d?i.replace(/[^\d\.]/g,"").split(".")[0]:s},trim:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},T={rgx:function(i,e){for(var o,r,a,d,l,w,u=0;u0?2==d.length?typeof d[1]==n?this[d[0]]=d[1].call(this,w):this[d[0]]=d[1]:3==d.length?typeof d[1]!==n||d[1].exec&&d[1].test?this[d[0]]=w?w.replace(d[1],d[2]):s:this[d[0]]=w?d[1].call(this,w,d[2]):s:4==d.length&&(this[d[0]]=w?d[3].call(this,w.replace(d[1],d[2])):s):this[d]=w?w:s;u+=2}},str:function(i,e){for(var o in e)if(typeof e[o]===t&&e[o].length>0){for(var n=0;n> + +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 099ca54d2..8ff9001ef 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'faisalman:ua-parser-js', - version: '0.7.14', + version: '0.7.28', summary: 'Lightweight JavaScript-based user-agent string parser', git: 'https://github.com/faisalman/ua-parser-js.git', documentation: 'readme.md' diff --git a/package.json b/package.json index 3d87497b0..499b2d1cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "UAParser.js", "name": "ua-parser-js", - "version": "0.7.14", + "version": "0.7.28", "author": "Faisal Salman (http://faisalman.com)", "description": "Lightweight JavaScript-based user-agent string parser", "keywords": [ @@ -15,72 +15,136 @@ "jquery-plugin", "ecosystem:jquery" ], - "homepage": "http://github.com/faisalman/ua-parser-js", + "homepage": "https://github.com/faisalman/ua-parser-js", "contributors": [ "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 ", + "Faisal Salman ", "Frédéric Camblor ", + "Frederik Ring ", + "Gerald Host ", + "Germán M. Bravo ", "Grigory Dmitrenko ", + "gulpin ", "Hendrik Helwich ", + "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 ", - "Levente Balogh ", + "Levente Balogh ", "Liam Quinn ", "Lithin ", + "ll-syber <670159357@qq.com>", + "Loris Guignard ", + "Lukas Drgon ", "Lukas Eipert ", "Malash ", - "Martynas ", + "Martynas ", + "Masahiko Sato ", + "Matt Brophy ", + "Matthew Origer ", "Maximilian Haupt ", "Max Maurer ", + "Max Nordlund ", "Michael Hess ", - "naoh ", + "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 ", + "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 ", - "Yun Young-jin " + "Yılmaz ", + "yuanyang ", + "Yun Young-jin ", + "Zach Bjornson " ], "main": "src/ua-parser.js", "scripts": { - "build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js -o 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" }, @@ -96,17 +160,18 @@ ] }, "devDependencies": { - "jshint": "~1.1.0", - "mocha": "~1.8.0", + "jshint": "~2.12.0", + "mocha": "~8.2.0", "requirejs": "^2.3.2", - "uglify-js": "~2.7.5", + "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" }, - "license": "(GPL-2.0 OR MIT)", + "license": "MIT", "engines": { "node": "*" }, @@ -117,5 +182,15 @@ }, "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" + "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 da7bc48ba..30871ebfa 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1,26 @@ -# UAParser.js +

+ +

+ +

+ + + + + +

- A JavaScript-based User-Agent string parser. Can be used either in browser (client-side) or in node.js (server-side) environment. Also available as jQuery/Zepto plugin, Bower/Meteor package, & RequireJS/AMD module. This library aims to identify detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model, entirely from user-agent string with a relatively small footprint (~11KB when minified / ~4KB gzipped). Written in vanilla JavaScript, which means it doesn't require any other library and can be used independently. However, it's not recommended to use this library as browser detection since the result may not accurate than using feature detection. +# UAParser.js -[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master)](https://travis-ci.org/faisalman/ua-parser-js) -[![NPM downloads](https://img.shields.io/npm/dw/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js) -[![NPM](https://img.shields.io/npm/v/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js) -[![Bower](https://img.shields.io/bower/v/ua-parser-js.svg)](https://bower.io/) -[![CDNJS](https://img.shields.io/cdnjs/v/UAParser.js.svg)](https://cdnjs.com/libraries/UAParser.js) -[![Gratipay](https://img.shields.io/gratipay/team/UAParser.js.svg)](https://gratipay.com/UAParser.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 <> * Demo : http://faisalman.github.io/ua-parser-js * Source : https://github.com/faisalman/ua-parser-js -# Constructor +# Documentation + +## Constructor * `new UAParser([uastring][,extensions])` * returns new instance @@ -22,37 +28,44 @@ * `UAParser([uastring][,extensions])` * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` -# Methods +## Methods * `getBrowser()` * returns `{ name: '', version: '' }` -``` +```sh # Possible 'browser.name': -Amaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Bowser, Camino, Chimera, -Chrome [WebView], 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, Sleipnir, -SlimBrowser, Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, WeChat, 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, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron, RIM, -Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, 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 ``` @@ -60,10 +73,10 @@ Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, 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 ``` @@ -71,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, PC-BSD, 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 ``` @@ -86,9 +100,9 @@ Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk * `getCPU()` * returns `{ architecture: '' }` -``` +```sh # Possible 'cpu.architecture' -68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] +68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] ``` * `getResult()` @@ -98,30 +112,30 @@ Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk * returns UA string of current instance * `setUA(uastring)` - * set UA string to parse + * set UA string to be parsed * returns current instance +# Usage -# Example +## Using HTML ```html - - +