coderef

WEBGL_debug_shaders WebGL extensionBaseline · Widely available

The WEBGL_debug_shaders extension for WebGL 1.0 and 2.0 contexts adds the getTranslatedShaderSource() method to debug shaders from privileged contexts.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 16, 2020. Widely available since Mar 16, 2023.

Browser support

DesktopChrome
1–46Not supported
47+Supportedsince Dec 1, 2015
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–55Not supported
56+Supportedsince Sep 28, 2017
Current: 157
Safari
1–13.1Not supported
14+Supportedsince Sep 16, 2020
Current: 27
MobileChrome Android
18–46Not supported
47+Supportedsince Dec 2, 2015
Current: 155
Firefox Android
4–55Not supported
56+Supportedsince Sep 28, 2017
Current: 157
Safari iOS
1–13.4Not supported
14+Supportedsince Sep 16, 2020
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: WEBGL debug shaders.

Feature detection

JS · check before using
if ("WEBGL_debug_shaders" in globalThis) {
  // WEBGL_debug_shaders is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
WEBGL_debug_shaders47795614475614
WEBGL_debug_shaders.getTranslatedShaderSource47795614475614