The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
This implementation accepts a settings object of type EventListenerOptions.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
Decodes a string of data which has been encoded using base-64 encoding.
Decodes a string of data which has been encoded using base-64 encoding.
Creates a base-64 encoded ASCII string from a "string" of binary data.
Creates a base-64 encoded ASCII string from a "string" of binary data.
Returns the CacheStorage object associated with the current context.
Returns the CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
Cancels repeated action which was set up using setInterval.
Cancels repeated action which was set up using setInterval.
Clears the delay set by window.setTimeout().
Clears the delay set by window.setTimeout().
The close() method of the WorkerGlobalScope interface discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
The close() method of the WorkerGlobalScope interface discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap.
Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap. Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh.
Returns a boolean value that indicates whether a SharedArrayBuffer can be sent via a Window.postMessage() call.
Returns a boolean value that indicates whether a SharedArrayBuffer can be sent via a Window.postMessage() call.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().
Starts the process of fetching a resource from the network.
Starts the process of fetching a resource from the network.
The importScripts() method of the WorkerGlobalScope interface imports one or more scripts into the worker's scope.
The importScripts() method of the WorkerGlobalScope interface imports one or more scripts into the worker's scope.
Provides a mechanism for applications to asynchronously access capabilities of indexed databases.
Provides a mechanism for applications to asynchronously access capabilities of indexed databases.
Returns a boolean indicating whether the current context is secure or not.
Returns a boolean indicating whether the current context is secure or not.
The location read-only property of the WorkerGlobalScope interface returns the WorkerLocation associated with the worker.
The location read-only property of the WorkerGlobalScope interface returns the WorkerLocation associated with the worker. It is a specific location object, mostly a subset of the Location for browsing scopes, but adapted to workers.
The navigator read-only property of the WorkerGlobalScope interface returns the WorkerNavigator associated with the worker.
The navigator read-only property of the WorkerGlobalScope interface returns the WorkerNavigator associated with the worker. It is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers.
The onerror property of the WorkerGlobalScope interface represents an EventHandler to be called when the error event occurs and bubbles through the Worker.
The onerror property of the WorkerGlobalScope interface represents an EventHandler to be called when the error event occurs and bubbles through the Worker.
The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the languagechange event occurs and bubbles through the Worker.
The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the languagechange event occurs and bubbles through the Worker.
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.
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.
The onoffline property of the WorkerGlobalScope interface represents an EventHandler to be called when the offline event occurs and bubbles through the Worker.
The onoffline property of the WorkerGlobalScope interface represents an EventHandler to be called when the offline event occurs and bubbles through the Worker.
The ononline property of the WorkerGlobalScope interface represents an EventHandler to be called when the online event occurs and bubbles through the Worker.
The ononline property of the WorkerGlobalScope interface represents an EventHandler to be called when the online event occurs and bubbles through the Worker.
Returns the origin of the global scope, serialized as a string.
Returns the origin of the global scope, serialized as a string.
The postMessage() method of the DedicatedWorkerGlobalScope interface sends a message to the main thread that spawned it.
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.
The main scope that spawned the worker can send back information to the thread that spawned it using the Worker.postMessage method.
The object to deliver to the main thread; this will be in the data field in the event delivered to the Worker.onmessage handler. This may be any value or JavaScript object handled by the structured clone algorithm, which includes cyclical references.
An optional array of Transferable objects to transfer ownership of. If the ownership of an object is transferred, it becomes unusable in the context it was sent from and it becomes available only to the main thread it was sent to. Only MessagePort and ArrayBuffer objects can be transferred.
Enqueues a microtask—a short function to be executed after execution of the JavaScript code completes and control isn't being returned to a JavaScript caller, but before handling callbacks and other tasks.
Enqueues a microtask—a short function to be executed after execution of the JavaScript code completes and control isn't being returned to a JavaScript caller, but before handling callbacks and other tasks.
This lets your code run without interfering with other, possibly higher priority, code, but before the browser runtime regains control, potentially depending upon the work you need to complete.
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
This implementation accepts a settings object of type EventListenerOptions.
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
The self read-only property of the WorkerGlobalScope interface returns a reference to the WorkerGlobalScope itself.
The self read-only property of the WorkerGlobalScope interface returns a reference to the WorkerGlobalScope itself. Most of the time it is a specific scope like DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, or ServiceWorkerGlobalScope.
Calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function.
Calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function.
Calls a function or executes a code snippet after a specified delay.
Calls a function or executes a code snippet after a specified delay.
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.