[Zope] Re: IE 5x lies about itself
Michael Lewis
michael@nichestaffing.com
13 Feb 2003 10:54:08 -0700
On Thu, 2003-02-13 at 04:35, Josef Meile wrote:
> --- In zope@yahoogroups.com, David Bear <David.Bear@a...> wrote:
> > I've been trying to conceptualize how I could select content
> > FORMATTING based on the browser that connects. My thought was to use
> > the request.HTTP_USER_AGENT and see about parsing and selecting there.
> >
> > The ugly thing is that IE starts out saying its mozilla. here's the
> > results of various UA strings.
> >
> >
> > IE 5.5
> > Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)
<dtml-if "_.string.find(HTTP_USER_AGENT, 'MSIE 5') >= 0">
> >
> > IE 6.0
> > Mozilla/4.0 (copmatible; MSIE 6.0, Windows NT 5.0)
> <dtml-if "_.string.find(HTTP_USER_AGENT, 'MSIE 6') >= 0">
> >
> > Netscape 4.7
> > Mozilla/4.79 [en] (Windows NT 5.0; U)
> <dtml-if "_.string.find(HTTP_USER_AGENT, 'Mozilla/4.7') >= 0">
> >
> > Real Mozilla
> > Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020721
<dtml-if "_.string.find(HTTP_USER_AGENT, 'Mozilla/5' and 'Gecko') >= 0">
If you want to test for Linux, Unix, etc.,
<dtml-if "_.string.find(HTTP_USER_AGENT, 'Mozilla/5' and 'Gecko' and
'Linux') >= 0">
It helps checking for MSIE first.
Michael
>