Results 21 - 40 of 164


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


The ExtendableMessageEvent interface of the ServiceWorker API represents the event object of a message event fired on a service worker (when a channel message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events.
API Experimental ExtendableMessageEvent Interface Reference Service Workers


The ImageBitmapFactories mixin interface contains utility methods to create an ImageBitmap. There is no object of this type, but the two interfaces Window, available within the regular browsing scope, and the WorkerGlobalScope interface for workers, implement this interface.
API Canvas Interface Mixin Reference Workers


The scope read-only property of the ServiceWorkerRegistration interface returns a unique identifier for a service worker registration. The service worker must be on the same origin as the document that registers the ServiceWorker.
API Property Reference scope Service Workers ServiceWorkerRegistration


The unregister method of the ServiceWorkerRegistration interface unregisters the service worker registration and returns a Promise. The promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called ServiceWorkerContainer.register with the same scope.) The service worker will finish any ongoing operations before it is unregistered.
API Method Reference Service Workers ServiceWorkerRegistration unregister


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


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


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

Using Web Workers

A worker is an object created using a constructor (e.g. Worker()) that runs a named JavaScript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. Thus, using the window shortcut to get the current global scope (instead of self) within a Worker will return an error.
Advanced Firefox Guide HTML5 JavaScript Workers


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


The WorkerGlobalScope interface of the Web Workers API is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop.
API Interface NeedsBrowserCompatibility Reference WorkerGlobalScope Workers


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


The ExtendableEvent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
API Experimental ExtendableEvent Interface Offline offline Reference Service Workers ServiceWorker Workers


The isReload read-only property of the FetchEvent interface returns true if the event was dispatched by the user attempting to reload the page, and false otherwise. Pressing the refresh button is a reload while clicking a link and pressing the back button is not.
API Experimental Expérimental FetchEvent isReload Property Reference Référence Service Service Workers Workers