All Projects → zsxsoft → Useragent.js

zsxsoft / Useragent.js

Licence: mit
A User-agent analyze project.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Useragent.js

Visitor-Parser-JS
Visitor Parser JS
Stars: ✭ 20 (-71.43%)
Mutual labels:  user-agent
Yauaa
Yet Another UserAgent Analyzer
Stars: ✭ 472 (+574.29%)
Mutual labels:  user-agent
Browser Detect
Browser Detection for Laravel by hisorange!
Stars: ✭ 657 (+838.57%)
Mutual labels:  user-agent
Platform.js
A platform detection library.
Stars: ✭ 2,937 (+4095.71%)
Mutual labels:  user-agent
Agent
👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
Stars: ✭ 3,891 (+5458.57%)
Mutual labels:  user-agent
Browser.php
A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.
Stars: ✭ 546 (+680%)
Mutual labels:  user-agent
whoami.js
A simple and lightweight browser detection and logger library
Stars: ✭ 16 (-77.14%)
Mutual labels:  user-agent
Parser Javascript
Browser sniffing gone too far — A useragent parser library for JavaScript
Stars: ✭ 66 (-5.71%)
Mutual labels:  user-agent
Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+32578.57%)
Mutual labels:  user-agent
Kolpa
A fake data generator written in and for Go
Stars: ✭ 645 (+821.43%)
Mutual labels:  user-agent
Isbot
💻 JavaScript module that detects bots/crawlers/spiders via the user agent
Stars: ✭ 290 (+314.29%)
Mutual labels:  user-agent
Android Smartwebview
A webview integrated w/ native features to help create most advanced hybrid applications.
Stars: ✭ 357 (+410%)
Mutual labels:  user-agent
User agent
HTTP User Agent parser for the Go programming language.
Stars: ✭ 578 (+725.71%)
Mutual labels:  user-agent
Useragent Switcher
A User-Agent spoofer browser extension that is highly configurable
Stars: ✭ 261 (+272.86%)
Mutual labels:  user-agent
Bugz
🐛 Composable User Agent Detection using Ramda
Stars: ✭ 15 (-78.57%)
Mutual labels:  user-agent
Server
Server written in PHP, provides a Javascript API for in the browser
Stars: ✭ 34 (-51.43%)
Mutual labels:  user-agent
User Agents
A JavaScript library for generating random user agents with data that's updated daily.
Stars: ✭ 485 (+592.86%)
Mutual labels:  user-agent
React Device Detect
Detect device, and render view according to detected device type.
Stars: ✭ 1,145 (+1535.71%)
Mutual labels:  user-agent
Th3inspector
Th3Inspector 🕵️ Best Tool For Information Gathering 🔎
Stars: ✭ 1,041 (+1387.14%)
Mutual labels:  user-agent
Ua Parser Js
UAParser.js - Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment.
Stars: ✭ 6,421 (+9072.86%)
Mutual labels:  user-agent

useragent.js

npm Coverage Status Build Status David deps npm GitHub release

A User-agent analyze project. Demo: http://project.zsxsoft.com/useragent.js/withimage.html

Compatibility

  • Nodejs >= 0.12
  • Windows Script Host (ASP / WScript / CScript)
  • Edge / Chrome / Firefox / Safari / Internet Explorer >= 8

IE<8

Import a Polyfill of Object.keys before import this. See here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys)

Installion

$ npm install useragent.js

Usage

Nodejs

const userAgent = require("useragent.js");
const ua = userAgent.analyze("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2251.0 Safari/537.36");
console.log(`TEST UA: ${ua.ua}`);
console.log(`TEST BROWSER: ${ua.browser.full} (${ua.browser.name}, ${ua.browser.version})`);
console.log(`TEST OS: ${ua.os.full} (${ua.os.name}, ${ua.os.version})`);
console.log(`TEST DEVICE: ${ua.device.full}`);

Webpack / browserify

import Useragent from 'useragent.js';
console.log(Useragent);

Browser

Click here

(function () {
  var ua = USERAGENT.analyze(navigator.userAgent);
  document.getElementById("useragent").innerHTML = ua.ua;
  document.getElementById("browser").innerHTML = ua.browser.full + " (" + ua.browser.name + " VERSION = "  + ua.browser.version + " )";
  document.getElementById("os").innerHTML = ua.os.full + " (" + ua.os.name + " VERSION = "  + ua.os.version + " )";
  document.getElementById("device").innerHTML = ua.device.full;
})();

Requirejs

Click here

Classical ASP

Click here

Test

$ npm test

Result

{ ua: 'Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 IPadQQ/4.1.1.14',
  os:
   { ua: 'Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 IPadQQ/4.1.1.14',
     name: 'iOS',
     version: '7.1.2',
     full: 'iOS 7.1.2',
     windows: false,
     linux: false,
     x64: false,
     dir: 'os',
     image: 'mac-3' },
  device:
   { ua: 'Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 IPadQQ/4.1.1.14',
     name: 'Apple iPad',
     image: 'ipad',
     brand: 'Apple',
     model: 'iPad',
     dir: 'device',
     full: 'Apple iPad' },
  browser:
   { ua: 'Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 IPadQQ/4.1.1.14',
     name: 'QQ',
     version: '4.1.1.14',
     full: 'QQ 4.1.1.14',
     image: 'qq',
     dir: 'browser' },
  platform: 
  /*
    Copied from device or os.
    .platform = .device, 
        but if device.name === "" then .platform = .os
   */
   { ua: 'Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 IPadQQ/4.1.1.14',
     name: 'Apple iPad',
     image: 'ipad',
     brand: 'Apple',
     model: 'iPad',
     dir: 'device',
     full: 'Apple iPad' } }

Supported Browsers/Platforms

Click here to see full list.

Tested Browsers: Amazon Silk / Android Webkit / Avant Browser / Comodo Dragon / curl / Firefox / Google Chrome / Internet Explorer / Microsoft Edge / Links / Lynx / Maxthon / MxNitro / Opera / QQBrowser / Safari SRWare Iron / Teleca Q7 / UC Browser / Vivaldi / W3M / wget / Yandex.Browser and so on..

OS: Android / Arch Linux / CentOS / Chrome OS / Debain / Fedora / FreeBSD / OSX / Red Hat / openSUSE / SymbianOS / Unix / Palm webOS / Windows 3.1 - 10 / Ubuntu / Linux and so on..

Devices: Xiaomi / BlackBerry / Nexus / HTC / Huawei / Kindle / Lenovo / LG / Motorola / Nokia / OnePlus / PlayStation / Samsung / Sony Xperia / ZTE / Ubuntu / Windows Phone / Apple Family and so on.

License

The MIT License

Images

Download icons from php-useragent.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].