Author: | rogeriotaques |
---|---|
Views Total: | 1,030 views |
Official Page: | Go to website |
Last Update: | April 27, 2016 |
License: | MIT |
Preview:

Description:
Detectr.js is a lightweight JavaScript library that detects the web browser (type & version), platform and OS using user agent and adds the corresponding CSS classes to elements you specify.
Basic usage:
Just include the derectr.js JS library on the webpage and we’re ready to go.
<script src="detectr.js"></script>
Assumed that you’re using Google Chrome Browser (v49) and the plugin will automatically adds the following CSS classes to your html tag.
<html class=".webkit .chrome .chrome49 .windows .nt .nt10.0 .x64 .js .svg .no-retina .landscape" > ... </html>
All the CSS classes:
- .edge: Microsoft Edge
- .ie: Internet Explorer
- .ie{version}: E.g. ie10.
- .webkit: Browsers based on the webkit
- .iron: Iron Web Browser
- .chrome: Google Chrome
- .chrome{version}: E.g. chrome49
- .firefox: Firefox Browser
- .firefox{version}: E.g. firefox32
- .opera: Opera Browser
- .opera{version}: E.g. opera16
- .konqueror: Konqueror Browser
- .safari: Safari Browser
- .safari{version}: E.g. safari12
- .gecko: Browsers based on gecko
- .android-browser: Android native browsers
- .mac: Apple Macintosh
- .osx{version}: E.g. osx10_10
- .ios{version}: E.g. ios8
- .windows: Microsoft Windows
- .win2k: Microsoft Windows 2000
- .win2k.sp1: Microsoft Windows 2000 SP1
- .xp: Microsoft Windows XP
- .vista: Microsoft Windows Vista
- .win7: Microsoft Windows 7
- .win8: Microsoft Windows 8
- .win8_1: Microsoft Windows 8.1
- .win10: Microsoft Windows 10
- .nt: Microsoft Windows NT
- .nt{version}: E.g. nt6.1
- .webtv: Web TV
- .freebsd: Freebsd
- .linux: Linux
- .android: Android
- .bb{version}: E.g. bb10 (for Blackberry 10)
- .x32: Platform 32 bits
- .x64: Platform 64 bits
- .arm: Platform ARM
- .iphone: Apple iPhone
- .ipad: Apple iPad
- .ipod: Apple iPod
- .mobile: Any mobile device
- .blackberry: Blackberry
- .touch: Touch screen devices
- .js: Javascript supported
- .svg: SVG Images supported
- .no-svg: SVG Images NOT supported
- .retina: Devices with pixelratio > 1
- .no-retina: Devices with pixelration = 1
- .portrait: Portrait orientation
- .landscape: Landscape orientation