[thelist] the regular expression for detecting gecko browser later then Fx 1.0?

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Fri Apr 28 07:56:21 CDT 2006


Just out of curiosity

Why on earth do people still need to sniff user agent strings?

1. it is not reliable.
2. it is unnecessary (simply do an object detection and if certain objects
are not supported give a POHS (plain old HTML solution) instead).


> So is there an universal way to detect if the gecko browser is supported?



There is NO WAY to detect user agents universally.

1. What if the browser's scripting support is disabled.
2. What if the browser sets a custom user agent header (Opera is excellent
on this)
3. What if I made a brand new browser (using an open source code base) and
name it
with something garbage data like
"[Volkan's private browser] Mozilla/4.0 (compatible; Gecko 6.0; Fedora Linux
NT 5.1; .NET CLR 2.1.4322; Sybase)"


> could for sure add some test like ereg('Gecko\/Debian-1') for debian, but
> > what if someone come up ask their firefox on yellowdog Linux, firefox on
> xxx
> > OS gives fault warning message?



That's exactly the point. You can never be 100% confident.
Do not detect browser version at all. This will relieve all your pain.

Or am I wrong?

HTH,
--
Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
+> My projects/studies/trials/errors : http://www.sarmal.com/



More information about the thelist mailing list