JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 185
  • Score
    100M100P100Q65350F
  • License MIT

Detect the OS, Browser and WebView from UserAgent String.

Package Exports

  • uupaa.useragent.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uupaa.useragent.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

UserAgent.js Build Status

npm

Detect the OS, Browser and WebView from UserAgent String.

This module made of WebModule.

Documentation

Browser, NW.js and Electron

<script src="UserAgent.js/lib/WebModule.js"></script>
<script src="UserAgent.js/node_modules/uupaa.webgldetector.js/lib/WebGLDetector.js"></script>
<script src="UserAgent.js/lib/UserAgent.js"></script>
<script>

var ua = new UserAgent();
console.dir(ua);
</script>
{
  "OS":             "Mac",
  "OS_VERSION":     "10.9.5",
  "BROWSER":        "Chrome",
  "BROWSER_ENGINE": "Blink",
  "BROWSER_VERSION": "44.0.2403",
  "USER_AGENT":     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36",
  "LANGUAGE":       "en",
  "WEB_VIEW":       false,
  "DEVICE":         "",
  "AOSP":           false,
  "iOS":            false,
  "Android":        false,
}

WebWorkers

importScripts("UserAgent.js/lib/WebModule.js");
importScripts("UserAgent.js/node_modules/uupaa.webgldetector.js/lib/WebGLDetector.js");
importScripts("UserAgent.js/lib/UserAgent.js");

Node.js

require("UserAgent.js/lib/WebModule.js");
require("UserAgent.js/node_modules/uupaa.webgldetector.js/lib/WebGLDetector.js");
require("UserAgent.js/lib/UserAgent.js");