guide
Functions and classes available to Web Workers
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.
Functions available in workers
The following functions are available to workers:
atob()btoa()clearInterval()clearTimeout()createImageBitmap()dump()fetch()queueMicrotask()reportError()setInterval()setTimeout()structuredClone()postMessage()(dedicated workers only)requestAnimationFrame()(dedicated workers only)cancelAnimationFrame()(dedicated workers only)
The following functions are only available to workers:
Web APIs available in 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:
Background Fetch APIBackground Synchronization APIBarcode Detection APIBroadcast Channel APICanvas APIChannel Messaging APICompression Streams APICompute Pressure APIConsole APIContent Index APICookie Store API(service workers only)CSS Font Loading APIEncoding APIFetch APIFile APIFile System APIIdle Detection APIIndexedDB APIMedia Capabilities APIMedia Source Extensions API(dedicated workers only)Network Information APINotifications API- [
Payment Handler API](https://developer.mozilla.org/en-US/docs/Web/API/Payment Handler API) Performance APIPermissions APIPrioritized Task Scheduling APIPush APIReporting APIServer-Sent EventsService Worker APIStreams APITrusted Types APIURL APIURL Pattern APIUser-Agent Client Hints APIWeb Crypto APIWeb Locks APIWeb Serial APIWeb Periodic Background Synchronization APIWebCodecs APIWebGL APIWebGPU APIWebHID API(dedicated and service workers only)WebUSB APIWebSockets APIXMLHttpRequest API
Workers can also spawn other workers, so these APIs are also available: