Bowser is a javascript library for detecting browser.
With Bowser you can get browser information, device information (mobile/tablet), OS information (MAC, Windows, linux, iOS, Android, WindowsPhone etc.)
Device.js makes it easy to write conditional CSS and/or JavaScript based on device operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo, AppleTV, etc), orientation (Portrait vs. Landscape), and type (Tablet vs. Mobile)