SharedWorkerGlobalScope extension type
The SharedWorkerGlobalScope
object (the SharedWorker global scope)
is accessible through the window.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 the complete list of
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
- onconnect ↔ EventHandler?
-
getter/setter pair
- onerror ↔ OnErrorEventHandler?
-
getter/setter pairinherited
- onlanguagechange ↔ EventHandler?
-
getter/setter pairinherited
- onoffline ↔ EventHandler?
-
getter/setter pairinherited
- ononline ↔ EventHandler?
-
getter/setter pairinherited
- onrejectionhandled ↔ EventHandler?
-
getter/setter pairinherited
- 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
-
clearInterval(
[int id]) → void -
inherited
-
clearTimeout(
[int id]) → void -
inherited
-
close(
) → void -
The
close()
method of the SharedWorkerGlobalScope interface discards any tasks queued in theSharedWorkerGlobalScope
'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 withdispatchEvent()
.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
-
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
-
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