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?

12 thoughts on “No JS/No CSS Browser Detection

  1. 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.

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

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

  4. 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)

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

  6. 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!

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

  8. 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).

  9. 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.