SharedWorker class

The interface represents a specific kind of worker that can be accessed from several browsing contexts, such as several windows, iframes or even workers. They implement an interface different than dedicated workers and have a different global scope, SharedWorkerGlobalScope.

Note: If SharedWorker can be accessed from several browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host and port).

EventTarget

SharedWorker

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

Constructors

SharedWorker(String scriptURL, [dynamic options])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
onerror EventHandlerNonNull<Event>?

Available on AbstractWorker, provided by the PropsAbstractWorker extension

getter/setter pair
port MessagePort

Available on SharedWorker, provided by the PropsSharedWorker extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

toString() String
A string representation of this object.
inherited

Operators

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