SharedWorkerGlobalScope Class

The global object of a shared worker (https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworkerglobalscope-interface): each SharedWorker object connected to the worker fires a connect event, whose port is entangled with the SharedWorker.Port of the object.

public sealed class SharedWorkerGlobalScope : WorkerGlobalScope
Inheritance
WorkerGlobalScope SharedWorkerGlobalScope

Properties

NameDescription
OnConnectGets or sets the event handler of the connect event.
WorkerNamehttps://html.spec.whatwg.org/multipage/workers.html#dom-sharedworkerglobalscope-name

Gets or sets the event handler of the connect event.

public Action<Event>? OnConnect { get; set; }

https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworkerglobalscope-name

public string WorkerName { get; }

Methods

NameDescription
Close()Closes the worker (https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworkerglobalscope-close).

Closes the worker (https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworkerglobalscope-close).

public void Close()