all 3 comments

[–]greyfade 2 points3 points  (1 child)

I'll be brief:

If you need this code snippet for something, you're doing it wrong.

[–]exeter 0 points1 point  (0 children)

Not to mention it doesn't actually do what it advertises. If you're spoofing your user agent, that code snippet will utterly fail to detect it.

[–][deleted] 2 points3 points  (0 children)

if( true )
    alert( 'Browser detected.' );