In addition to the standard JavaScript set of functions (such as String, Array, Object, JSON, etc.), there are a variety of functions (and APIs) available in the workers. This article provides a list of those.
The following functions are available to workers:
WorkerGlobalScope.atob()WorkerGlobalScope.btoa()WorkerGlobalScope.clearInterval()WorkerGlobalScope.clearTimeout()WorkerGlobalScope.createImageBitmap()WorkerGlobalScope.dump() WorkerGlobalScope.fetch()WorkerGlobalScope.queueMicrotask()WorkerGlobalScope.reportError()WorkerGlobalScope.setInterval()WorkerGlobalScope.setTimeout()WorkerGlobalScope.structuredClone()DedicatedWorkerGlobalScope.postMessage() (dedicated workers only)DedicatedWorkerGlobalScope.requestAnimationFrame() (dedicated workers only)DedicatedWorkerGlobalScope.cancelAnimationFrame() (dedicated workers only)The following functions are only available to workers:
Note: If a listed API is supported by a platform in a particular version, then it can generally be assumed to be available in web workers. You can test support for a particular object or function using the Worker Playground.
The following Web APIs are available to workers:
StylePropertyMap)Workers can also spawn other workers, so these APIs are also available: