Click here to Skip to main content
12,954,672 members (72,650 online)
Rate this:
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!


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
Updated 2-Mar-11 21:28pm
Manfred R. Bihy 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:

The above link is to the page that contains the javascript for the tests. Maybe you can extract some information from there.
hansoctantan 3-Mar-11 19:55pm
Rate this: bad
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.



Here you'll find a "HTML5 Testpage" project on GIT. The index.html file is especially interesting:[^]
SAKryukov 3-Mar-11 3:11am
That is correct :<
As this is not entirely your fault, I find it possible to vote 5. :-)
Manfred R. Bihy 3-Mar-11 4:57am
Thanks SA!
Dalek Dave 3-Mar-11 4:23am
Good Call.
Manfred R. Bihy 3-Mar-11 4:58am
I appreciate it! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

The better solution is to use something like Modernizr ( 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 >


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


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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,539
CHill60 3,490
Maciej Los 3,153
ppolymorphe 2,030
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2017
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