8 ms·
Browser sniffing is a bad idea, because it is unreliable and difficult to maintain. Users can change their UA, and it is possible that a full-featured browser
by byoung2 13y ago
Browser sniffing is a bad idea, because it is unreliable and difficult to maintain. Users can change their UA, and it is possible that a full-featured browser will use a UA string that inadvertently matches your regexp (e.g. a WebKit browser with the useragent "NOT MSIE 9.0, NOT Trident"). It may also be possible (however unlikely) to add in the missing functionality in older Internet Explorer versions with plugins or patches, but your browser sniffing would assume that the functionality is not there based on version.
It is better to do feature detection (e.g. with Modernizr http://modernizr.com/docs/ http://modernizr.com/docs/).