UAParser.js
For just a one-time fee you can get the most comprehensive, compact, & up-to-date JavaScript user-agent detection library
Non-commercial license - unlimited projects
Commercial license - 1 license per-project basis
Commercial license - unlimited projects