Fixed #2033 --Switched from user agent to feature detection.

Feature detection is more secure and reliable than using userAgent's arbitrary string matching
for accurate browser identification.