I need to detect whether my web app is running on a desktop or mobile. Googling for this question, I have found two solutions:
navigator.userAgent