A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/port below:

SharedWorker: port property - Web APIs

SharedWorker: port property

Limited availability

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

Value

A MessagePort object.

Examples

The following code snippet shows creation of a SharedWorker object using the SharedWorker() constructor. Multiple scripts can then access the worker through a MessagePort object accessed using the SharedWorker.port property — the port is started using its start() method:

const myWorker = new SharedWorker("worker.js");
myWorker.port.start();

For a full example, see our Basic shared worker example (run shared worker.)

Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3