I need to detect 3 types of device: tablet, mobile or desktop.

I found a script for detecting mobile on github, but how I can detect mobile, tablet and desktop?

Edit
Report