This feature is not Baseline because it does not work in some of the most widely-used browsers.
The SharedWorkerGlobalScope object (the SharedWorker 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 the complete list of functions available to workers.
This interface inherits properties from the WorkerGlobalScope interface, and its parent EventTarget.
The name that the SharedWorker was (optionally) given when it was created using the SharedWorker() constructor. This is mainly useful for debugging purposes.
This interface inherits methods from the WorkerGlobalScope interface, and its parent EventTarget.
Discards any tasks queued in the SharedWorkerGlobalScope's event loop, effectively closing this particular scope.
Listen to this event using addEventListener() or by assigning an event listener to the oneventname property of this interface.
connectFired on shared workers when a new client connects.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
SharedWorkerGlobalScope |
4 | 79 | 29 | 10.6 | 165–7 | No | 29 | 11 | 165–7 | No | No | 165–7 |
close |
4 | 79 | 29 | 10.6 | 165–7 | No | 29 | 11 | 165–7 | No | No | 165–7 |
connect_event |
4 | 79 | 29Before version 65 thedata property of the event object was null; it is now initialized to an empty string, as per spec. |
10.6 | 165–7 | No | 29Before version 65 thedata property of the event object was null; it is now initialized to an empty string, as per spec. |
11 | 165–7 | No | No | 165–7 |
name |
4 | 79 | 29 | 10.6 | 165–7 | No | 29 | 11 | 165–7 | No | No | 165–7 |
© 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/SharedWorkerGlobalScope