May 17, 2008

No JS/No CSS Browser Detection

[Browser detection removed as it broke the validation of my RSS feed. Check the author's site if you want to try it out.]

This browser detection uses pure HTML 2.0, without any JS or CSS. Here's how it's done. It even distinguishes Firefox 1.5 from Firefox 2. Can any parser hackers extend it to further distinguish Firefox 3?

Posted by gerv at May 17, 2008 8:03 AM | TrackBack
Comments

Nice try... However, it detects my Safari (on Win XP, all settings are by default) as Opera when I read your blog via Google Reader, and as Firefox when I read your blog directly.

Posted by: Alexey Filippov at May 17, 2008 8:46 AM

Just great; on the author's page it considers my Safari to be IE.

Posted by: Alexey Filippov at May 17, 2008 8:48 AM

That would be Opera when read through Google Reader at all (I read it there with Firefox)

Posted by: Callek at May 17, 2008 8:55 AM

It seems both Google Reader and Gervase's blog engine preprocess the HTML, so that \x00 gets replaced to \xEFBF here. (I've lost a link to Google, so cannot check it out)

Posted by: Alexey Filippov at May 17, 2008 9:17 AM

Both Safari 3 and Camino trunk are identified as Firefox here, on Leopard.

Posted by: Ben Willmore at May 17, 2008 9:26 AM

Both Safari 3 and Camino trunk are identified as Firefox here, on Leopard.

Posted by: Ben at May 17, 2008 9:27 AM

Well, I tried to turn off as much preprocessing as possible. My version is probably not accurate, then. Check the author's site as well before posting results, please!

Posted by: Gerv at May 17, 2008 10:53 AM

You could maybe detect firefox 3 with some added object-tag testing, though then it wouldn't be HTML 2.0...

Posted by: ant at May 17, 2008 1:07 PM

WebKit trunk is showing up as Firefox here, and IE on the author's site.

Posted by: David Smith at May 17, 2008 11:34 PM

The version in your RSS feed is showing up as Firefox when viewed in NetNewswire Lite (and it's pretty likely to be using Webkit as the rendering engine, though I haven't looked).

Posted by: Dave Miller at May 18, 2008 3:28 AM

Works perfectly now (FF 3.0 on Linux), but in Google Reader it thought I was an Opera user.

Posted by: Andrew Min at May 18, 2008 7:01 PM

On Mac OS X 10.3.9 Camino is detected as Firefox (same Geko as Firefox) and Safari 1.3.2 is detected as Safari 2.

Posted by: Paul at May 20, 2008 5:26 AM
Post a comment





(You may wish to obfuscate)




Remember personal info?


This entry box accepts some HTML. You will need to escape < as &lt; and > as &gt;. Useful tags: <blockquote>, <b>.