WorkerGlobalScope extension type
The WorkerGlobalScope
interface of the
Web Workers API
is an interface representing the scope of any worker. Workers have no
browsing context; this scope contains the information usually conveyed by
Window objects — in this case event handlers, the console or the
associated WorkerNavigator object. Each WorkerGlobalScope
has its own
event loop.
This interface is usually specialized by each worker type:
DedicatedWorkerGlobalScope for dedicated workers,
SharedWorkerGlobalScope for shared workers, and ServiceWorkerGlobalScope
for
ServiceWorker.
The self
property returns the specialized scope for each context.
- on
- Implemented types
- Implementers
- Available extensions
Properties
- caches → CacheStorage
-
no setter
- crossOriginIsolated → bool
-
no setter
- crypto → Crypto
-
no setter
- fonts → FontFaceSet
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- indexedDB → IDBFactory
-
no setter
- isSecureContext → bool
-
no setter
- location → WorkerLocation
-
no setter
-
no setter
- onerror ↔ OnErrorEventHandler?
-
getter/setter pair
- onlanguagechange ↔ EventHandler?
-
getter/setter pair
- onoffline ↔ EventHandler?
-
getter/setter pair
- ononline ↔ EventHandler?
-
getter/setter pair
- onrejectionhandled ↔ EventHandler?
-
getter/setter pair
- onunhandledrejection ↔ EventHandler?
-
getter/setter pair
- origin → String
-
no setter
- performance → Performance
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- self → WorkerGlobalScope
-
no setter
- trustedTypes → TrustedTypePolicyFactory
-
no setter
Methods
-
addEventListener(
String type, EventListener? callback, [JSAny options]) → void -
The
addEventListener()
method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.inherited -
atob(
String data) → String -
btoa(
String data) → String -
clearInterval(
[int id]) → void -
clearTimeout(
[int id]) → void -
createImageBitmap(
ImageBitmapSource image, [JSAny optionsOrSx, int sy, int sw, int sh, ImageBitmapOptions options]) → JSPromise< ImageBitmap> -
dispatchEvent(
Event event) → bool -
The
dispatchEvent()
method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually withdispatchEvent()
.inherited -
fetch(
RequestInfo input, [RequestInit init]) → JSPromise< Response> -
importScripts(
String urls) → void -
The
importScripts()
method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queueMicrotask(
VoidFunction callback) → void -
removeEventListener(
String type, EventListener? callback, [JSAny options]) → void -
The
removeEventListener()
method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.inherited -
reportError(
JSAny? e) → void -
setInterval(
TimerHandler handler, JSAny? arguments, [int timeout]) → int -
setTimeout(
TimerHandler handler, JSAny? arguments, [int timeout]) → int -
structuredClone(
JSAny? value, [StructuredSerializeOptions options]) → JSAny? -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited