const gl = canvas.getContext("webgl", {
antialias: false,
depth: false,
});OffscreenCanvas: getContext() method / notebook
OffscreenCanvas: getContext() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("webgl");
gl; // WebGLRenderingContext
gl.canvas; // OffscreenCanvas