Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (54 sloc) 2.11 KB
<title>Test for WebGL</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
var gl;
function browserSupportsWebGL() {
if (window.WebGLRenderingContext === undefined) {
return false
} else {
return true
function webglContextCreationErrorHandler(evt) {
if (evt.statusMessage) {
document.getElementById("status-message").textContent = evt.statusMessage;
function webGLTest() {
var canvas = document.getElementById("canvas");
var results = document.getElementById("results");
canvas.addEventListener("webglcontextcreationerror", webglContextCreationErrorHandler, false);
try {
gl = canvas.getContext("experimental-webgl");
} catch(e) {
var result = "";
if (!gl && browserSupportsWebGL()) {
result = "Your browser supports WebGL but there was an error starting up. This may mean you need to update your video drivers. Try: <a href=''></a>";
} else if (!gl) {
result = "Your browser does not support WebGL. Try: <a href=''></a>";
} else {
result = "Your browser supports WebGL";
results.innerHTML = result;
<body onload="webGLTest();">
<h3>Test Browser for WebGL Capability</h3>
<p id="results"></p>
<h4>Browser-specific status message</h4>
<p id="status-message"></p>
<h4>Test input element for Chrome 10 bug (versions older than 10.0.648.204)</h4>
<p>Chrome bug: <a href="">experimental-webgl" breaks page on chrome 10</a></p>
<form id="form1">
<label id="label1" for="input1">Enter text: </label>
<input type="text" id="input1" name="input1" />
<input type="submit" value="Submit" />
<p>On Chrome 10 versions older than 10.0.648.204 on Windows you will not see text you enter into the input field.</p>
<canvas id="canvas" style="border: none;" width="100" height="100"></canvas>
Something went wrong with that request. Please try again.