Dedicated workersBaseline · Widely available
The Worker() constructor runs a script in its own thread, which can send and receive messages with the script that created it. Also known as web workers.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.
Browser support
DesktopChrome
1–3Not supported
4+Supportedsince Jan 25, 2010
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–3.6Not supported
4+Supportedsince Mar 22, 2011
Current: 157Safari
1–3.1Not supported
4+Supportedsince Jun 8, 2009
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157Safari iOS
1–4.2Not supported
5+Supportedsince Oct 12, 2011
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: DedicatedWorkerGlobalScope.
Feature detection
JS · check before using
if ("DedicatedWorkerGlobalScope" in globalThis) {
// DedicatedWorkerGlobalScope is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (31). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| DedicatedWorkerGlobalScope | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| DedicatedWorkerGlobalScope.close | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| DedicatedWorkerGlobalScope.name | 70 | 18 | 55 | 12.1 | 70 | 55 | 12.2 |
| Worker | 2 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| Worker.Worker | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| Worker.Worker.mime_checks | ✕ | ✕ | 81 | 16 | ✕ | 81 | 16 |
| Worker.Worker.options_name_parameter | 70 | 18 | 55 | 12.1 | 70 | 55 | 12.2 |
| Worker.error_event | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| Worker.terminate | 2 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| Worker.worker_support | ✕ | ✕ | 34 | ✕ | ✕ | 34 | ✕ |
| WorkerGlobalScope | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerGlobalScope.error_event | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerGlobalScope.importScripts | 4 | 12 | 4 | 4 | 18 | 4 | 5 |
| WorkerGlobalScope.importScripts.mime_checks | 71 | 79 | 67 | 16 | 71 | 67 | 16 |
| WorkerGlobalScope.location | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerGlobalScope.navigator | 4 | 17 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerGlobalScope.rejectionhandled_event | 49 | 79 | 69 | 11 | 49 | 79 | 11 |
| WorkerGlobalScope.self | 4 | 12 | 3.5 | 4 | 18 | 34 | 5 |
| WorkerGlobalScope.unhandledrejection_event | 49 | 79 | 69 | 11 | 49 | 79 | 11 |
| WorkerLocation | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
Show 11 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| WorkerLocation.hash | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.host | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.hostname | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.href | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.origin | 38 | 14 | 29 | 10 | 38 | 29 | 10 |
| WorkerLocation.pathname | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.port | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.protocol | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.search | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerLocation.toString | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |
| WorkerNavigator | 4 | 12 | 3.5 | 4 | 18 | 4 | 5 |