UA string.

Darin Adler darin at apple.com
Fri Feb 21 00:33:00 GMT 2003


On Thursday, February 20, 2003, at 04:05 PM, Dirk Mueller wrote:

> On Don, 20 Feb 2003, Darin Adler wrote:
>
>> Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/60 (KHTML,
>> like Gecko) Safari/60
>
> hmm, the second pair of brackets is not going to be a problem for some
> websites?

We've always had those two sets of parentheses.

> I guess we should change our to
>
> Mozilla/5.0 (compatible; Konqueror/3.1; KHTML, like Gecko; Linux)
>
> But thats not really compatible to your format.

Might be OK. We the key is that they can just look for the substring 
KHTML.

> Mozilla/5.0 (compatible; Konqueror/3.1; Linux) (KHTML, like Gecko)

Seems as good as the above, not a lot better though. I guess they can 
look for "(KHTML," in this one, which might be better.

> Is there any spec on UserAgent string formatting?

I wish there was. There are some documents at mozilla.org, but that's 
all I could find.

> Though this clashes with websites that treat "compatible" as MSIE,

Right, that's why we use the word "like" instead of "compatible".

> and expect "Gecko" after the closing brackets to detect it as Gecko.

We did that on purpose, of course. Many pages don't give modern 
standards-compliant content unless they see the substring Gecko 
somewhere, but they don't care where.

> Mozilla/5.0 (compatible; U; Linux; en-us) KHTML/3.1 like Gecko

That's more like us, but has the problem that "compatible" is going to 
make many simple-minded sites think you are IE; we found that led to 
bad results.

> BTW, do you happen to know the meaning of the "U;" ? :-)

I do not. I am preparing a document explaining our user agent string 
that might some day go up on developer.apple.com, and that's one of the 
unanswered questions in my current draft.

     -- Darin





More information about the kfm-devel mailing list