UA string.

Vadim Plessky vplessky at faringosept.ru
Sun Feb 23 10:33:56 GMT 2003


Hi,

On Friday 21 February 2003 09:45, Stig Nygaard wrote:
|  Hi,
|
|  > Is there any spec on UserAgent string formatting?
|
|  Some links on Netscape DevEdge and MS:
|
|  http://devedge.netscape.com/viewsource/2002/browser-statistics/
|  http://devedge.netscape.com/viewsource/2002/browser-detection/
|  http://www.mozilla.org/build/revised-user-agent-strings.html
|  http://devedge.netscape.com/viewsource/2002/gecko-useragent-strings/
|  http://support.microsoft.com/default.aspx?scid=kb;EN-US;272413
|
|  Removing the word "compatible" from the UA string would in my opinion be
|  wrong, because this will indicate it's a Netscape browser. If there are
|  sites (I haven't seen any!?) which always identify the browser as IE if
|  "compatible" is missing from the UA-string, those sites should be
|  contacted to correct the error instead - in my opinion. I'm sure 99% of
|  all browsersniffing look for the "MSIE" signature when detecting IE
|  serverside.

while detecting "msie" in UA string, like:

var MSIE_in_UA = (agent_lowcase.indexOf("msie") != -1);

is indeed very common, there are other widely used methods to *guess* that 
browser is MS IE.

In particular, quite often they look for "document.all" support
var doc_all = (document.all) ? true : false;

and automatically suggest that browser is MS IE or compatible, if document.all 
is supported.
Good point with Konqueror/KHTML that we auotomatically detected as MS IE in 
this case (without faking userAgent!), and sites using such detection usually 
work quite well with Konqueror/KHTML (I don't have Mac and can't check how 
good they are with Safari)

There are several sites, though, which look for word "Microsoft" inside UA, 
and on top of this, want major version number to be >= 4.

I am speaking about code like this:
 if (manufacturer.indexOf('Microsoft')>=0 && major >=4 )
 {    IE4up = 1;  }

Don't ask me *why* they do detection like this, I just listed different 
possibilities for browser detection, which are somewhat widely used.

|
|  Stig.

-- 

Best Regards,

Vadim Plessky
SVG Icons * BlueSphere Icons 0.3.0 released
http://svgicons.sourceforge.net





More information about the kfm-devel mailing list