[Zope] Serverside Browser detection

Brian Lloyd Brian@digicool.com
Thu, 23 Sep 1999 14:04:48 -0400


> I would like to detect whether the client browser can render 
> png images. I see the
> following from Netscape 4.61
> HTTP_ACCEPT     image/gif, image/x-xbitmap, image/jpeg, 
> image/pjpeg, image/png, */*
> HTTP_USER_AGENT Mozilla/4.61 [en] (Win95; I)
> 
> and this from MSIE 5.0
> HTTP_ACCEPT     image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
>                 application/vnd.ms-excel, application/msword, */*
> HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt;
>                         btclick.com Build BTCFUNFD1)
> 
> I know that MSIE 5.0 can render png's (by observation) and by 
> report that Netscape 3.x
> cannot.
> 
> Question:
> Parse HTTP_USER_AGENT to determine netscape/msie or do I rely 
> on the apparently unreliable
> HTTP_ACCEPT?

HTTP_ACCEPT is definitely unreliable - in fact I often
wonder why they waste bandwidth with image/gif etc. when
they just go and tack '*/*' on the end... :^)

There has been some recent discussion on the list of some
kind of 'supports' database that would let you figure out
client capabilities, but I don't know if anyone ran with
that...

Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com