Home > BrowserDetect > HTML 2.0 - Browser detection [3]

HTML 2.0 - Browser detection [3]

New browser detection only with HTML 2.0 without any JavaScript/CSS hacks.

HTML 2.0 - Browser detection [3]

It can detect firefox2.0, firefox1.5, other Gecko engine, and Safari2, Safari3, Opera, ie, w3m, lynx, and other browsers.

html20hacks-snapshot.png


Comments:34

Mike 07-10-04 (Thu) 4:59

Does not seem to work with IE. I get the “others” image using IE 6.0.2900.2180.

joe complainer 07-10-04 (Thu) 5:16

How about a hack that turns your background color to something that makes the text readable?

Grey and darkblue on blue? Gah!

Ray 07-10-04 (Thu) 5:43

First, it’s unclear how this approach would actually be useful. Second, it’s a hack. Browser bugs are not the foundation of solid software.

zeuben 07-10-04 (Thu) 6:03

how are you supposed to implement this??
PERL? are you kidding?

impuLsive 07-10-04 (Thu) 6:06

Nice find there. :)

Ozh 07-10-04 (Thu) 6:30

Wow. This is pure genius.

Will 07-10-04 (Thu) 6:37

IE 6 SP2 is showing up as others.gif

Jason Daivd Hopkins 07-10-04 (Thu) 7:06

Great idea…did some messing around and noticed this works with any html attribute, meaning it’d be a simple way to create cross browser designs without the need for javascript.

Tim McCormack 07-10-04 (Thu) 7:36

Hah, pretty interesting (in a proof-of-concept sort of way.)

I like how lynx is distinguished from the others.

Acidblue 07-10-04 (Thu) 7:53

But, there is no actual detection. Sure, the browser renders a different img src based on browser quirks, but how is this to be actually useful? How could you change the ‘behavior’ on the server or even the client?

Nice. 07-10-04 (Thu) 8:21

Me likey.

Genius 07-10-04 (Thu) 8:40

This is nifty and all, but how is it actually useful?
I mean, generally when trying to detect a browser you do it because you want to modify your display depending on the browser. In this case, yea, you can see a different image with different browsers, but the rest of the content can’t be modified with it.

Jon Grant 07-10-04 (Thu) 8:44

Hi there, Interesting script you’ve written. Looking at :
http://wafful.org/~takesako/html20hacks/browser-detect3.html

…it doesn’t quite work, displaying firefox1_5.gif when I am running Firefox 2.0.x
Cheers, Jon

Pai 07-10-04 (Thu) 9:41

great hack man.. but does it work only on Perl file? how do we implement this on php?

James Justin Harrell 07-10-04 (Thu) 9:52

Whatever happened to content negotiation?

Kelly 07-10-04 (Thu) 10:52

Since the detection (1) happens on the client and (2) is not in JavaScript… I’m not sure I get the point.

I would like to see what you do with this info after you have it. Can you post an example?

Riddle 07-10-04 (Thu) 11:44

Amazing work. However, I don’t know how one could use this. :)

Jim 07-10-04 (Thu) 14:14

guys… you use this hack to insert browser specific attributes in key spots (it works on all attributes, not just in the img tag)

for instance you could use a spacer image which is different pixel sizes depending on the browser. or you could use this hack and then use javascript to detect what the src attribute’s value was (this, I believe, uses less javascript than most other browser detection methods)

sentio 07-10-04 (Thu) 14:19

My Safari 3 beta for Windows is detected as MS Internet Explorer ;)

netmastan 07-10-04 (Thu) 16:42

this is bullshit.. misleading title. Why the hell i use perl to detect browser ..where i can do with php or asp or javascript.
css can be used also like this
#mydiv {
height:30px;/*for all browser*/
#height:30px;/* for ie only */
_height:30px;/*for ie6 or older version*/
}

Shani elharrar 07-10-04 (Thu) 18:00

Thats really nice, but does it validate? ;)

Chool 07-10-04 (Thu) 18:15

great picture!!!

http://wafful.org/~takesako/html20hacks/others.gif

Phil Blunt 07-10-04 (Thu) 19:15

This is hardcore, good find.

subcorpus 07-10-04 (Thu) 19:52

is this useful …???
what might be the use for this type of detection … ???

Marcus 07-10-04 (Thu) 21:39

Nice feature. ;-)

Disco 07-10-04 (Thu) 23:18

Why do so many people not see how this could be useful? It’s pretty clear. Sure, there are other ways to create the same effect… And now there’s one more.. Great!

It’s also pretty kick-ass.. Nice work.

Rodney Pacis 07-10-04 (Thu) 23:35

you are the mother fucking man! wow that is the most awesomest browser detection thing i have ever found!

to bad it only works in perl

Eduo 07-10-05 (Fri) 1:06

Disco: For the same reason that people are arguing if this is done in Perl, mainly.

Lack of clues never forbade anyone from putting their 2 cents’ worth, especially if it’s free.

mdmadph 07-10-05 (Fri) 4:54

Thank you for realizing what “proof of concept” is and why its cool.

To all of you asking “how is this useful” — please lookup “proof of concept” in your nearest dictionary or encyclopedia, immediately.

Ice9 07-10-05 (Fri) 11:09

@Idiots, it doesn’t “only work with perl”. The author just used perl to output the HTML. It would also work as a plain HTML file, or with php, java, whatever.

willard 07-10-05 (Fri) 22:55

God you folks are thick.
1. “I cant see how this is useful” Its meant to be a proof-of-concep - so the author discovered it and thought “you know what I’ll share this hack with the world..” and then the masses moaned for full on demos on rewriting their 1998 “HTML for Dummies” code into something that works on all browsers…
2. “how can I make this work with php..” Duhhhh its just being printed with perl. Just output it in a normal html file. God help us..

Brennan 07-10-06 (Sat) 7:17

It’s in Perl because it prints non-displayable characters. See where it says \x00 and \x03? Those are hex codes. Sure you could just show the characters as the browser shows them, but most people would see ? or boxes in their place and wonder why they can’t reproduce the hack.

Thanks for posting this, I find it amusing.

Michael Kranika 07-10-06 (Sat) 8:36

we presented my comments before the day wednesday, yet you transfer them to trash? why is so, we wanted just to say plud for showing the usage of the same trick on our new site www:polandbigbreast.co.pl
we think the trick of the browser detection is a great trick and we will be using it at polandbigbreast.co.pl.
Thankyour for advance,
Michael Kranika

Mordechai Peller 07-10-07 (Sun) 6:40

For those who don’t understand how to use this, here’s one simple way: use it to load browser specific JavaScript or CSS.

While writing browser independent code is usually a better option, this is an alternative.

Comment Form
Remember personal info

Trackback+Pingback:14

TrackBack URL for this entry
http://wafful.org/2007/10/01/html-20-browser-detection-3/trackback/
Listed below are links to weblogs that reference
HTML 2.0 - Browser detection [3] from wafful.org - Web Security Blog
Pingback from img only Browser detection at TrickJarrett.com 07-10-04 (Thu) 6:08

[…] img only Browser detection Share: These icons link to social bookmarking sites where readers can share and discover new web pages. […]

Pingback from Jonathon Zone » Blog Archive » img tag hack to detect browsers 07-10-04 (Thu) 10:00

[…] firefox2.0, firefox1.5, other Gecko engine, and Safari2, Safari3, Opera, ie, w3m, lynx, and others.read more | digg […]

Pingback from Andra P žurnāls » Blog Archive » Pārlūka noteikšana izmantojot visparastāko HTML 07-10-04 (Thu) 14:30

[…] HTML/CSS dizainu, kas daudz maz normāli strādātu uz visiem modernajiem pārlūkiem. Bet šī pieeja, ko uzgāju Digg.com, ir interesanta. Tā nav precīza un izmantot to praksē arī būtu […]

Pingback from Detecta el navegador del usuario mediante HTML | aNieto2K 07-10-04 (Thu) 15:09

[…] Pero con la aparición de nuevas versiones de HTML, la HTML 2.0, podemos condicionar esta problemática desde el propio HTML. […]

Pingback from Img tag hack to detect browsers « v1ruz blog 07-10-04 (Thu) 20:50

[…] read more | digg story No Comments so far Leave a comment RSS feed for comments on this post. TrackBack URI Leave a comment Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> […]

Pingback from Farhadi’s Blog » بایگانی وبنامه (وب‌نامه (وبلاگ)) » شناسایی مرورگر بدون استفاده از JavaScript/CSS 07-10-05 (Fri) 21:27

[…] http://wafful.org/2007/10/01/html-20-browser-detection-3 […]

Pingback from Fatih Hayrioğlu’nun not defteri » 09 Ekim 2007 Web’den Seçme Haberler 07-10-09 (Tue) 16:14

[…] Javascript kullanmadan tarayıcı tespiti yapmak. Bağlantı […]

Pingback from /* Cómo usar un hack de img para detectar navegadores, sin CSS ni JavaScript 07-10-10 (Wed) 4:19

[…] información y […]

Pingback from Savaitgalio skaitiniai #38 » Pixel.lt 07-10-13 (Sat) 22:01

[…] Savaitgalio skaitiniai: The Structured Web - A Primer Releasing the Source Code for the .NET Framework Libraries LockBox Computing: 25 Free Tools To Encrypt Literally Everything HTML 2.0 - Browser detection […]

Pingback from img tag hack to detect browsers « Programming News 07-10-17 (Wed) 20:43

[…] read more | digg story […]

Pingback from html » HTML 2.0 - Browser detection [3] 07-10-19 (Fri) 11:38

[…] the rest of this great post here […]

Pingback from ThemePassion - Best stuff about design! » HTML 2.0 - Browser detection [3] 07-10-22 (Mon) 0:08

[…] desconocido wrote an interesting post today!.Here’s a quick excerptNew browser detection only with HTML 2.0 without any JavaScript/CSS hacks. HTML 2.0 - Browser detection [3]. It can detect firefox2.0, firefox1.5, other Gecko engine, and Safari2, Safari3, Opera, ie, w3m, lynx, and other browsers. […]

Pingback from rushda » Blog Archive » HTML 2.0 - Browser detection [3] 07-10-23 (Tue) 2:02

[…] sourced here […]

Pingback from hgecom » HTML 2.0 - Browser detection [3] 07-10-23 (Tue) 2:50

[…] here for […]

Home > BrowserDetect > HTML 2.0 - Browser detection [3]

Feeds
Meta

Page Top