Beware of the Leopard
Published 21 years, 11 months pastApple has launched a new open-source browser called Safari. I wonder how Tim O’Reilly feels about that, given how long ago he launched his own Safari.
Unfortunately, the user agent string of Safari is Netscape 5.0 Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/48 (like Gecko) Safari/48
. “Like Gecko?” Right. So if you’re doing client sniffing, better make sure you aren’t catching Safari in your “test for Gecko” code, because it’s not very much like Gecko. Once again we see why client detection is a dangerously fragile and ultimately futile approach to, well, anything on the Web. If you absolutely must detect, do object detection: look for support for the things you need to make your application work. Otherwise, follow the standards and don’t try to serve up customized content, styles, or scripts to anyone.