Results 1 - 20 of 36

WorkerLocation

The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling window.self.location.
API Web Workers

AbstractWorker

The AbstractWorker interface of the Web Workers API abstracts properties and methods common to all kind of workers, being Worker or SharedWorker.
AbstractWorker API Interface Reference Référence Web Workers

SharedWorker

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.
API Interface Reference SharedWorker Web Workers Workers

SharedWorker.port

The port property of the SharedWorker interface returns a MessagePort object used to communicate and control the shared worker.
API port Property Reference SharedWorker Web Workers

SharedWorkerGlobalScope

The SharedWorkerGlobalScope object (the SharedWorker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.
API Interface Reference SharedWorkerGlobalScope Web Workers

Transferable

The Transferable interface represents an object that can be transfered between different execution contexts, like the main thread and Web workers.
API Interface Reference Référence Web Workers

Worker()

The Worker() constructor creates a Worker object that executes the script at the specified URL. This script must obey the same-origin policy.
API Constructor Reference Référence Web Workers Worker

WorkerGlobalScope.dump()

The dump() method of the WorkerGlobalScope interface allows you to write a message to stdout — i.e. in your terminal, in Firefox only. This is the same as Firefox's window.dump, but for workers.
API dump Method Reference Web Workers WorkerGlobalScope

AbstractWorker.onerror

The AbstractWorker.onerror property of the AbstractWorker interface represents an EventHandler, that is a function to be called when the error event occurs and bubbles through the Worker.
AbstractWorker API EventHandler onerror Property Reference Référence Web Workers Workers

DedicatedWorkerGlobalScope

The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers.
API DedicatedWorkerGlobalScope Interface NeedsBrowserCompatibility Reference Référence Web Workers Workers

DedicatedWorkerGlobalScope.onmessage

The onmessage property of the DedicatedWorkerGlobalScope interface represents an EventHandler to be called when the message event occurs and bubbles through the Worker — i.e. when a message is sent to the worker using the Worker.postMessage method.
API DedicatedWorkerGlobalScope onmessage Property Reference Référence Web Workers

DedicatedWorkerGlobalScope.postMessage()

The postMessage() method of the DedicatedWorkerGlobalScope interface sends a message to the main thread that spawned it. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled by the structured clone algorithm, which includes cyclical references.
API DedicatedWorkerGlobalScope Method postMessage Reference Référence Web Workers

SharedWorker()

The SharedWorker() constructor creates a SharedWorker object that executes the script at the specified URL. This script must obey the same-origin policy.
API Constructor Reference Shared Workers SharedWorker Web Workers

SharedWorkerGlobalScope.name

The name read-only property of the SharedWorkerGlobalScope interface returns the name that the SharedWorker was (optionally) given when it was created. This is the name that the SharedWorker() constructor can pass to get a reference to the SharedWorkerGlobalScope.
API name Property Reference Référence SharedWorkerGlobalScope Web Workers

SharedWorkerGlobalScope.onconnect

The onconnect property of the SharedWorkerGlobalScope interface is an EventHandler representing the code to be called when the connect event is raised — that is, when a MessagePort connection is opened between the associated SharedWorker and the main thread.
API onconnect Property Reference Référence SharedWorkerGlobalScope Web Workers

Web Workers API

Web Workers are a mechanism by which a script operation can be made to run in a background thread separate from the main execution thread of a web application. The advantage of this is that laborious processing can be performed in a separate thread, allowing the main (usually the UI) thread to run without being blocked/slowed down.
API Service Workers Shared Workers Web Workers Workers

Worker

The Worker interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread.
API DOM Interface JavaScript Reference Référence Web Workers Worker Workers

Worker.onmessage

The onmessage property of the Worker interface represents an EventHandler, that is a function to be called when the message event occurs. These events are of type MessageEvent and will be called when the worker's parent receives a message (i.e. from the DedicatedWorkerGlobalScope.postMessage method.
API EventHandler onmessage Property Reference Référence Web Workers Worker

Worker.postMessage()

The postMessage() method of the Worker interface sends a message to the worker's inner scope. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled by the structured clone algorithm, which includes cyclical references.
API JavaScript Method postMessage Reference Référence Web Workers Worker