The emergence of the HTML5 specifications has gotten me all excited about the future of web pages and the possibility of web applications finally catching up with their desktop counterparts (in terms of speed and richness). For just getting my hands a little dirty with the "magical" HTML5 dust, I decided to quickly write up some sample code to detect some features I thought were important. Of course, I have skipped quite a few (I haven't read the complete specs yet).
If you want to take a look at what I've coded up, click here to download the files. The Html5Detect object queries most properties as simple getter functions.
Property | Chrome4 | Opera10 | Safari4 | Firefox3.5 |
---|---|---|---|---|
canvas | TRUE | TRUE | TRUE | TRUE |
canvasText | TRUE | FALSE | TRUE | TRUE |
video | TRUE | FALSE | TRUE | TRUE |
h264 video | probably | FALSE | probably | FALSE |
OGG video | probably | FALSE | FALSE | probably |
localStorage | TRUE | FALSE | TRUE | TRUE |
workers | TRUE | FALSE | TRUE | TRUE |
applicationCache | FALSE | FALSE | TRUE | TRUE |
geoLocation | FALSE | FALSE | TRUE | TRUE |
placeholder | TRUE | FALSE | FALSE | FALSE |
autofocus | TRUE | TRUE | TRUE | FALSE |
microdata | FALSE | FALSE | FALSE | FALSE |
inputTypes.search | TRUE | FALSE | TRUE | FALSE |
inputTypes.number | TRUE | TRUE | TRUE | FALSE |
inputTypes.range | TRUE | TRUE | TRUE | FALSE |
inputTypes.color | TRUE | FALSE | FALSE | FALSE |
inputTypes.tel | TRUE | FALSE | TRUE | FALSE |
inputTypes.url | TRUE | TRUE | TRUE | FALSE |
inputTypes.email | TRUE | TRUE | TRUE | FALSE |
inputTypes.date | FALSE | TRUE | FALSE | FALSE |
inputTypes.month | FALSE | TRUE | FALSE | FALSE |
inputTypes.time | FALSE | TRUE | FALSE | FALSE |
inputTypes.datetime | FALSE | TRUE | FALSE | FALSE |
inputTypes.datetimeLocal | FALSE | TRUE | FALSE | FALSE |
For all values of "probably", I haven't tried them out myself yet, but that's the value the detection returns. "probably" indicates that the browser is fairly confident that it can play this format. IE8 doesn't support any of the HTML5 elements I've tested for.
Let me know if there are any other browsers you would like to see included in this list. For further reading, I'd recommend following the HTML5 specification itself, as it is rapidly evolving.
Cheers.
No comments:
Post a Comment