The fact that UA is so easily spoofed makes it a really poor choice.
Client side JS for feature detection can work well, I have a simple example in the code of http://http-echo.com
Client side JS for feature detection can work well, I have a simple example in the code of http://http-echo.com
Client side feature detection can also be spoofed, but in practice that's bit a problem either.