Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
How can I check if a browser that supports HTML5 by using any programming/scripting language?
 
Thanks in advance!
 
Modification:
 
With the below given posts/answers, I found out what the best Browser is that supports HTML 5
Browser Scores: (this is in my computer)
Mozilla Firefox 3.6.13 = 155 and 04 bonus points
Opera 11.01 = 234 and 07 bonus points
Google Chrome = 282 and 13 bonus points
Safari = 228 and 07 bonus points
 
Can someone show me how to get or even just check if the browser can support some HTML 5.
I'd totally appreciate if someone can post a code.
Posted 2-Mar-11 19:45pm
Edited 2-Mar-11 21:28pm
v7
Comments
Manfred R. Bihy at 3-Mar-11 3:27am
   
I found some code in a project on GIT, but you'll have to read that stuff yourself in order to extract the necessary bits: https://github.com/NielsLeenheer/html5test/blob/master/index.html
 
The above link is to the page that contains the javascript for the tests. Maybe you can extract some information from there.
hansoctantan at 3-Mar-11 19:55pm
   
tnx
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is sounds like a very tough job as none of the existing browsers fully support HTML5. There are ones doing better at supporting a subset of HTML5 than others. There is a check on this page (HTML5 Test[^]) that gives you an idea what checks to integrate, but this page doesn't claim completeness. One page shows how your browser is scoring and second one shows the scores of other browsers as a comparison.
 
Cheers!
 
Modification:
 
Here you'll find a "HTML5 Testpage" project on GIT. The index.html file is especially interesting: https://github.com/NielsLeenheer/html5test/blob/master/index.html[^]
  Permalink  
v5
Comments
SAKryukov at 3-Mar-11 3:11am
   
That is correct :<
As this is not entirely your fault, I find it possible to vote 5. :-)
--SA
Manfred R. Bihy at 3-Mar-11 4:57am
   
Thanks SA!
Dalek Dave at 3-Mar-11 4:23am
   
Good Call.
Manfred R. Bihy at 3-Mar-11 4:58am
   
I appreciate it! :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
The better solution is to use something like Modernizr (http://www.modernizr.com/) to do your feature detection on the client-side.Modernizr is an open source, MIT-licensed JavaScript library that detects support for many HTML5 & CSS3 features.
If your browser does not support the canvas API, the Modernizr.canvas property will be false.
<script >
 
if (Modernizr.canvas) {
  // let&#39;s draw some shapes!
} else {
  // no native canvas support available :(
}</script >
 
Ref:http://diveintohtml5.info/detect.html[^]
 
Another solution if you are using JQuery:
Checking for support for the canvas element of HTML 5
var test_canvas = document.createElement("canvas") //try and create sample canvas element
var canvascheck=(test_canvas.getContext)? true : false //check if object supports getContext() method, a method of the canvas element
alert(canvascheck) //alerts true if browser supports canvas element
Ref:http://www.javascriptkit.com/javatutors/createelementcheck.shtml[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 254
1 Nirav Prabtani 223
2 Sergey Alexandrovich Kryukov 209
3 _Amy 165
4 Richard MacCutchan 135
0 OriginalGriff 7,799
1 Sergey Alexandrovich Kryukov 6,966
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100