Skip to content

Instantly share code, notes, and snippets.

@goldenratio
Created August 3, 2025 09:27
Show Gist options
  • Save goldenratio/e8c599202effa2c8943ac9556df3133f to your computer and use it in GitHub Desktop.
Save goldenratio/e8c599202effa2c8943ac9556df3133f to your computer and use it in GitHub Desktop.
document.querySelectorAll('canvas').forEach((canvas, i) => {
const ctx2d = canvas.getContext('2d');
const ctxWebGL = canvas.getContext('webgl') || canvas.getContext('webgl2');
console.log(`Canvas ${i}:`, {
'2D': !!ctx2d,
'WebGL': !!ctxWebGL
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment