JS code snippet to detect browsers and versions