WorkerGlobalScope

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.

MDN Reference

Inheritors

Properties

Link copied to clipboard
open external val fonts: FontFaceSet
Link copied to clipboard
external val location: WorkerLocation

The read-only location property of the WorkerGlobalScope interface returns the WorkerLocation associated with the worker. It is a specific location object, mostly a subset of the Location for browsing scopes, but adapted to workers.

Link copied to clipboard

The navigator read-only property of the WorkerGlobalScope interface returns the WorkerNavigator associated with the worker. It is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers.

Link copied to clipboard

Functions

Link copied to clipboard
open external fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
open operator external fun get(key: String): JsAny?
open operator external fun get(key: PropertyKey): JsAny?
Link copied to clipboard
open operator external fun set(key: String, value: JsAny?)
open operator external fun set(key: PropertyKey, value: JsAny?)
Link copied to clipboard
external fun <T : Event> when(type: EventType<T>, options: ObservableEventListenerOptions?): Observable<T>