const canvas = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("2d");
canvas.addEventListener("contextrestored", (e) => {
console.log(e);
// call to redrawCanvas() or similar
});OffscreenCanvas: contextrestored event / notebook
OffscreenCanvas: contextrestored event
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.