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