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 
Detect the OS, Browser and WebView from UserAgent String.
Browser and NW.js(node-webkit)
<script src="<module-dir>/lib/WebModule.js"></script>
<script src="<module-dir>/lib/UserAgent.js"></script>
<script>
var ua = new UserAgent();
var result = {
OS: ua.OS,
OS_VERSION: ua.OS_VERSION,
BROWSER: ua.BROWSER,
BROWSER_ENGINE: ua.BROWSER_ENGINE,
BROWSER_VERSION: ua.BROWSER_VERSION,
USER_AGENT: ua.USER_AGENT,
LANGUAGE: ua.LANGUAGE,
WEB_VIEW: ua.WEB_VIEW,
DEVICE: ua.DEVICE,
AOSP: ua.AOSP,
// --- shorthand ---
iOS ua.iOS,
Android ua.Android,
};
console.dir(result);
/*
{
"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,
}
*/
</script>WebWorkers
importScripts("<module-dir>lib/WebModule.js");
importScripts("<module-dir>lib/UserAgent.js");
Node.js
require("<module-dir>lib/WebModule.js");
require("<module-dir>lib/UserAgent.js");