WorkerGlobalScope class

This Web Workers API interface 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.

MDN Reference

Implemented types
Implementers
Available extensions
Annotations

Constructors

WorkerGlobalScope()
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(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
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
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

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
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
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
reportError ↔ void Function([dynamic])

Available on WindowOrWorkerGlobalScope, provided by the WindowOrWorkerGlobalScope$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