Table of Contents

Class SharedWorker

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The SharedWorker 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.

[Value("SharedWorker")]
public class SharedWorker : EventTarget, AbstractWorker
Inheritance
SharedWorker
Implements
Inherited Members

Remarks

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).

-Worker

See also on MDN

Constructors

SharedWorker()

public SharedWorker()

SharedWorker(Union97, Union98)

The SharedWorker() constructor creates a
SharedWorker object that executes the script at the specified URL. This
script must obey the same-origin policy.

public SharedWorker(Union97 scriptURL, Union98 options = default)

Parameters

scriptURL Union97
options Union98

Remarks

NOTE

There is disagreement among browser manufacturers about
whether a data URL is of the same origin or not. Although Firefox 10.0
and later accept data URLs, that's not the case in all other
browsers.

-The SharedWorker interface it belongs to.

See also on MDN

Properties

Port

The port property of the SharedWorker
interface returns a MessagePort object used to communicate and control
the shared worker.

[Value("port")]
public MessagePort Port { get; }

Property Value

MessagePort

A MessagePort object.

Remarks