--- title: DedicatedWorkerGlobalScope slug: Web/API/DedicatedWorkerGlobalScope translation_of: Web/API/DedicatedWorkerGlobalScope ---
{{APIRef("Web Workers API")}}
The DedicatedWorkerGlobalScope
object (the {{domxref("Worker")}} global scope) is accessible through the {{domxref("window.self","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 {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements properties from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.
DedicatedWorkerGlobalScope
object itself.WorkerLocation
is a specific location object, mostly a subset of the {{domxref("Location")}} for browsing scopes, but adapted to workers.WorkerNavigator
is a specific navigator object, mostly a subset of the {{domxref("Navigator")}} for browsing scopes, but adapted to workers.This interface inherits event handlers from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements event handlers from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.
This interface inherits methods from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements methods from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.
any
JavaScript object — to the parent document that first spawned the worker.WorkerGlobalScope
's event loop, effectively closing this particular scope. importScripts('foo.js', 'bar.js');
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', '#dedicatedworkerglobalscope', 'DedicatedWorkerGlobalScope')}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName("Web Workers")}}. |
{{SpecName('Web Workers', '#dedicatedworkerglobalscope', 'DedicatedWorkerGlobalScope')}} | {{Spec2('Web Workers')}} | Initial definition. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatChrome(4)}} | {{CompatGeckoDesktop("1.9.1")}} | 10 | 10.6 | 4 |
ononline , onoffline |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("29")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
console {{Non-standard_inline}} |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("29")}}[1] {{CompatGeckoDesktop("30")}} |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
performance |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("34")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.9.1")}} | 1.0.1 | 10 | 11.5 | 5.1 |
ononline , onoffline |
{{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("29")}}[1] {{CompatGeckoMobile("30")}} |
1.4 | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
console {{Non-standard_inline}} |
{{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("29")}} | 1.4 | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
performance |
{{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("34")}} | 2.1 | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] Gecko 29.0 implemented this as WorkerConsole
. Gecko 30.0 changed this to the regular Console
.