Limited Availability
Canvas
id: canvas-context-lost
contextlost and contextrestored
The
contextlost event for <canvas> fires when the canvas backing storage is lost, while the contextrestored event fires when it is recreated.
Baseline Status:
This feature is currently Limited and is missing in at least one major browser engine.
Desktop Browser Engine Support
Google Chrome
99
Supported
Mozilla Firefox
125
Supported
Apple Safari
—
Unsupported
Microsoft Edge
99
Supported
Mobile Browser Engine Support
Chrome Android
99
Firefox Android
125
Safari iOS
—
Specifications and References
MDN Browser Compat Data Keys:
api.CanvasRenderingContext2D.isContextLost ↗
api.HTMLCanvasElement.contextlost_event ↗
api.HTMLCanvasElement.contextrestored_event ↗
api.OffscreenCanvas.contextlost_event ↗
api.OffscreenCanvas.contextrestored_event ↗
api.OffscreenCanvasRenderingContext2D.isContextLost ↗