DedicatedWorkerGlobalScope class

(the Worker 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 also: Functions available to workers.

MDN Reference

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

DedicatedWorkerGlobalScope.new()
factory

Properties

addEventListener → ({void Function<K$>(WorkerGlobalScopeEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
addEventListener → ({void Function<K$>(DedicatedWorkerGlobalScopeEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
addEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
atob String Function(String)

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
btoa String Function(String)

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
caches CacheStorage

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

Available only in secure contexts.
no setter
cancelAnimationFrame ↔ void Function(num)

Available on AnimationFrameProvider, provided by the AnimationFrameProvider$Typings extension

getter/setter pair
clearInterval ↔ void Function([num?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
clearTimeout ↔ void Function([num?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
close ↔ void Function()

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

getter/setter pair
createImageBitmap → ({Future<ImageBitmap> Function(Object image, [ImageBitmapOptions? options]) $1, Future<ImageBitmap> Function(Object image, num sx, num sy, num sw, num sh, [ImageBitmapOptions? options]) $2})

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
crossOriginIsolated bool

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
crypto Crypto

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
dispatchEvent bool Function(Event)

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
fetch Future<Response> Function(Object, [RequestInit?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
fonts FontFaceSet

Available on FontFaceSource, provided by the FontFaceSource$Typings extension

MDN Reference
no setter
hashCode int
The hash code for this object.
no setterinherited
importScripts ↔ void Function([Iterable?])

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

getter/setter pair
indexedDB IDBFactory

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
isSecureContext bool

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
location WorkerLocation

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

Returns workerGlobal's WorkerLocation object.
no setter
name String

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
no setter

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

Returns workerGlobal's WorkerNavigator object.
no setter
onerror ↔ dynamic Function(ErrorEvent)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
onlanguagechange ↔ dynamic Function(Event)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
onmessage ↔ dynamic Function(MessageEvent)?

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
onmessageerror ↔ dynamic Function(MessageEvent)?

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
onoffline ↔ dynamic Function(Event)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
ononline ↔ dynamic Function(Event)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

MDN Reference
getter/setter pair
onrejectionhandled ↔ dynamic Function(PromiseRejectionEvent)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

getter/setter pair
onunhandledrejection ↔ dynamic Function(PromiseRejectionEvent)?

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

getter/setter pair
origin String

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
performance Performance

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

MDN Reference
no setter
postMessage → ({void Function(List<Object> transfer, [dynamic message]) $1, void Function([dynamic message, StructuredSerializeOptions? options]) $2})

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
queueMicrotask ↔ void Function(VoidFunction)

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
removeEventListener → ({void Function<K$>(WorkerGlobalScopeEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
removeEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
removeEventListener → ({void Function<K$>(DedicatedWorkerGlobalScopeEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on DedicatedWorkerGlobalScope, provided by the DedicatedWorkerGlobalScope$Typings extension

Overload accessor: $1, $2
no setter
reportError ↔ void Function([dynamic])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
requestAnimationFrame num Function(FrameRequestCallback)

Available on AnimationFrameProvider, provided by the AnimationFrameProvider$Typings extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
self → _Intersection7

Available on WorkerGlobalScope, provided by the WorkerGlobalScope$Typings extension

Returns workerGlobal.
no setter
setInterval num Function(Object, [num?, Iterable?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
setTimeout num Function(Object, [num?, Iterable?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair
structuredClone ↔ T Function<T>(T, [StructuredSerializeOptions?])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$Typings extension

getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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