[Zope] Detecting Mozilla based browsers
Tino Wildenhain
tino@wildenhain.de
Mon, 31 Mar 2003 19:30:39 +0200
Hi,
detecting a special user-agent incarnation is usually a waste of time.
Instead of trying to detect one of 1423124982739 browsers with different
capabilities by their most of the time faked user-agent string,
one should focus to silently fall back and check only availability
of special attributes in the DOM.
IF you want to use a special DOM object, just look wether it is
defined and choose your action based on this.
This way you silently support all browsers which try to be the same
instead of making an endless growing list.
I personally HATE sites which tell me I would have an unsuported
browser only because their sucking scripts fail.
Pretty please stop this sillyness!
user-agent string is only ment informative and is by no way
relieable!
There exist several techniques to fall-back with CSS and
fall back with scripts. You should also provide usefull information
if scripting is disabled.
Regards
Tino Wildenhain
Eron Lloyd wrote:
> It would be nice to have a script used to identify many types of browsers
> (plus what features they support). I developed one (at home) that pulls the
> value from REQUEST.HTTP_USER_AGENT and guesses which one made the request,
> and returns a special code (ex. 'MSIE', 'Mozilla', 'Konqueror') which you can
> use in a decision tree from there. Would it be useful for the REQUEST object
> to have an API for this? Perhaps I'll play around a bit with it. Trouble is,
> like currancy converters, how do we keep the list up-to-date? An XML-RPC
> call? For features like Midas...good question. Not being real familiar with
> it, how do you invocate it in a page? It might not be possible to detect
> until it is released in the core with say, Mozilla 1.5, and you can know by
> the version number (unless it's disabled!)