Try using navigator.userAgent. But new