OffscreenCanvas

The OffscreenCanvas allows to create a canvas that can be rendered off screen. It can also be used in web workers.
Your browser does not support OffscreenCanvas.

If an app has long running rendering tasks (e.g. ray tracing in WebGL), running those tasks in a worker allows the web app’s UI to remain responsive while the rendering task runs continuously in the background.

The animation below is running a heavy task while changing the color theme. If you click on the button at such moment, the interaction is blocked for a short while causing bad user experience.

Canvas on main thread

Interaction is blocked when a theme is loading

Canvas on worker thread

Interaction works even if a theme is loading