"In general, our advice is to develop a responsive site that can adapt to the capabilities of different devices. If you choose to build a mobile-specific experience then we recommend looking for the sub-string "mobile" in the user agent string to determine when to deliver mobile optimised content:"
function isMobile() {
return navigator.userAgent.toLowerCase().indexOf("mobile")>=0;
}
This is really the best we can do after twenty years of the WWW?