Simple user agent detection library. (Node.js or Browser supported)
$ npm install sua.js
or
$ bower install sua.js
Support Browser
- ua.Android 2.1
- ua.Android 2.2
- ua.Android 2.3
- ua.Android 3.x
- ua.Android 4.x
- ua.Android 5.0
- ua.Android 5.1
- ua.iphone (IOS4)
- ua.iphone (IOS5)
- ua.iphone (IOS6)
- ua.iphone (IOS7)
- ua.iphone (IOS8)
- ua.iphone (IOS9)
- ua.iphone (IOS4-ipad)
- ua.iphone (IOS5-ipad)
- ua.iphone (IOS6-ipad)
- ua.iphone (IOS7-ipad)
- ua.iphone (IOS8-ipad)
- ua.iphone (IOS9-ipad)
- ua.iphone5 (hardware)
- ua.blackberry
- ua.webos
- ua.touchpad
- ua.kindle
- ua.silk
- ua.bb10
- ua.rimtabletos
- ua.playbook
- ua.ds
- ua.psp
- ua.psvita
- ua.windowsphone
- ua.safari
- ua.xbox
- ua.ie11
- ua.ie10
- ua.ie9
- ua.android.firefox
- ua.webview.twitter
$ make build # output: sua.min.js
Browser : $ ./spec/index.html
Terminal : $ make test
<script src="sua.js" />
<script>
// window.sua.setup();
window.sua.setup('Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25');
console.log(sua.browser.version);
JSON.stringify(sua.os, null, " ");
> "{
> "iphone": true,
> "ios": true,
> "version": "6.0",
> "tablet": false,
> "phone": true
> }"
JSON.stringify(sua.iphone, null, " ")
> "[
> "iPhone OS 6_0",
> "iPhone OS",
> "6_0"
> ]"
</script>
sua.js (size: 10721 byte) optimize none
sua.min.js (size: 3559 byte) optimize uglify2
@see : LICENSE