picayunish said:
I tested with Firebird and I get gecko.css when
I have set the UA as Mozilla, Netscape or as default.
Here is my Firebird UA string:
Mozilla/x (MyOS; MyBrowserIsMyBusiness) YouDontNeedToKnow 1.0
This ended up with other.css. If I change the Firebird UA to look like
some flavor of IE, gets ie.css. Shouldn't it always get gecko.css?
Consider for a moment that someone who changes their UA string will
probably make it look like a different browser altogether, not just
another variation of the same browser. Folks often do this precisely
because of the type of browser sniffing you are attempting. Clueless
authors look for a very limited number of browsers, when it comes across
anything else the script will likely do something undesireable.
I even tested with Opera and set the UA as Moz 3.0, Moz 4.8, IE 6.0 or
as default the script works perfectly.
It works perfectly if you believe what the UA string tells you. The
problem is that the UA may lie. My Opera identifying as IE gets ie.css.
This is probably wrong. Netscape 4.x getting a gecko.css is probably
wrong, too.
I.m.o the script isn't broken.
If your goal is just to parse the UA string, it isn't broken. If your
goal is to identify the actual browser, then it is indeed broken.