news

JavaScript device detection

 

For some recent project we required some device specific logic. After searching for javascript based libaries we couldn't find any appropriate and decided to write a small device detection library based on user agend parsing.

You can find it on GitHub: https://github.com/danielpoe/DeviceDetection

 

 

 

Please fell free to use and improve it with further checks and user agends. The lib comes with some basic QUnit test cases that can also be extended with the time.

Example Usage:

 

var detection = DeviceDetection(); 
detection.isApple();
detection.isTouchDevice();
detection.isAndroid();
detection.isSmartPhone();
detection.isDesktop();
detection.isTablet();

 

blog comments powered by Disqus
blogroll