DedicatedWorkerGlobalScope extension type

The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the WorkerGlobalScope.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.

on
Implemented types

Properties

caches CacheStorage
no setterinherited
crossOriginIsolated bool
no setterinherited
crypto Crypto
no setterinherited
fonts FontFaceSet
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
indexedDB IDBFactory
no setterinherited
isSecureContext bool
no setterinherited
location WorkerLocation
no setterinherited
name String
no setter
no setterinherited
onerror OnErrorEventHandler?
getter/setter pairinherited
onlanguagechange EventHandler?
getter/setter pairinherited
onmessage EventHandler?
getter/setter pair
onmessageerror EventHandler?
getter/setter pair
onoffline EventHandler?
getter/setter pairinherited
ononline EventHandler?
getter/setter pairinherited
onrejectionhandled EventHandler?
getter/setter pairinherited
onrtctransform EventHandler?
getter/setter pair
onunhandledrejection EventHandler?
getter/setter pairinherited
origin String
no setterinherited
performance Performance
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
self WorkerGlobalScope
no setterinherited
trustedTypes TrustedTypePolicyFactory
no setterinherited

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
inherited
btoa(String data) String
inherited
cancelAnimationFrame(int handle) → void
The cancelAnimationFrame() method of the DedicatedWorkerGlobalScope interface cancels an animation frame request previously scheduled through a call to DedicatedWorkerGlobalScope.requestAnimationFrame.
clearInterval([int id]) → void
inherited
clearTimeout([int id]) → void
inherited
close() → void
The close() method of the DedicatedWorkerGlobalScope interface discards any tasks queued in the DedicatedWorkerGlobalScope's event loop, effectively closing this particular scope.
createImageBitmap(ImageBitmapSource image, [JSAny optionsOrSx, int sy, int sw, int sh, ImageBitmapOptions options]) JSPromise<ImageBitmap>
inherited
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 with dispatchEvent().
inherited
fetch(RequestInfo input, [RequestInit init]) JSPromise<Response>
inherited
importScripts(String urls) → void
The importScripts() method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postMessage(JSAny? message, [JSObject optionsOrTransfer]) → void
The postMessage() method of the DedicatedWorkerGlobalScope interface sends a message to the main thread that spawned it.
queueMicrotask(VoidFunction callback) → void
inherited
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
inherited
requestAnimationFrame(FrameRequestCallback callback) int
The requestAnimationFrame() method of the DedicatedWorkerGlobalScope interface tells the browser you wish to perform an animation frame request and call a user-supplied callback function before the next repaint.
setInterval(TimerHandler handler, JSAny? arguments, [int timeout]) int
inherited
setTimeout(TimerHandler handler, JSAny? arguments, [int timeout]) int
inherited
structuredClone(JSAny? value, [StructuredSerializeOptions options]) JSAny?
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited