This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
Note: This feature is only available in Dedicated Web Workers.
The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers.
This interface inherits properties from the WorkerGlobalScope interface, and its parent EventTarget.
DedicatedWorkerGlobalScope.name Read only
The name that the Worker was (optionally) given when it was created using the Worker() constructor. This is mainly useful for debugging purposes.
This interface inherits methods from the WorkerGlobalScope interface, and its parent EventTarget.
DedicatedWorkerGlobalScope.close()Discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
DedicatedWorkerGlobalScope.postMessage()Sends a message — which can consist of any JavaScript object — to the parent document that first spawned the worker.
DedicatedWorkerGlobalScope.cancelAnimationFrame()Cancels an animation frame request previously scheduled through a call to requestAnimationFrame().
DedicatedWorkerGlobalScope.requestAnimationFrame()Perform an animation frame request and call a user-supplied callback function before the next repaint.
Listen to this event using addEventListener() or by assigning an event listener to the oneventname property of this interface.
messageFired when the worker receives a message from its parent.
messageerrorFired when a worker receives a message that can't be deserialized.
rtctransformFired when an encoded video or audio frame has been queued for processing by a WebRTC Encoded Transform.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
DedicatedWorkerGlobalScope |
4 | 12 | 3.5 | 10.6 | 4 | 18 | 4 | 11 | 5 | 1.0 | 4.4 | 5 |
cancelAnimationFrame |
69 | 79 | 99 | 56 | 16.4 | 69 | 99 | 48 | 16.4 | 10.0 | 67 | 16.4 |
close |
4 | 12 | 3.5 | 10.6 | 4 | 18 | 4 | 11 | 5 | 1.0 | 4.4 | 5 |
message_event |
4 | 12 | 3.5 | 10.6 | 4 | 18 | 4 | 11.5 | 5 | 1.0 | 4.4 | 5 |
messageerror_event |
60 | 18 | 57 | 47 | 16.4 | 60 | 57 | 47 | 16.4 | 8.0 | 60 | 16.4 |
name |
70 | 18 | 55 | 57 | 12.1 | 70 | 55 | 49 | 12.2 | 10.0 | 70 | 12.2 |
postMessage |
4 | 12 | 3.5 | 10.6 | 4 | 18 | 4 | 11 | 5 | 1.0 | 4.4 | 5 |
requestAnimationFrame |
69Not supported in nested Web Workers. See bug 41483010. |
79Not supported in nested Web Workers. See bug 41483010. |
99 | 56Not supported in nested Web Workers. See bug 41483010. |
16.4 | 69Not supported in nested Web Workers. See bug 41483010. |
99 | 48Not supported in nested Web Workers. See bug 41483010. |
16.4 | 10.0Not supported in nested Web Workers. See bug 41483010. |
67 | 16.4 |
rtctransform_event |
No | No | 117 | No | 15.4 | No | 117 | No | 15.4 | No | No | 15.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope