A worker is a script that runs in a background process and does not block other code processes attached to the page.
Inheritance HierarchyThe Worker does not inherit from any class or interface.
The Worker object has these types of members:
The Worker object has these events.
Returns an error if a worker throws an unhandled exception.
Returns a message from the parent thread to the worker thread, or between two MessagePort objects.
The Worker object has these methods.
Sends a message from the worker to the parent thread.
Terminates a worker thread immediately.
The Worker object has these properties.
You can send messages to a worker from the main document using postMessage. The message will be cloned. You can receive messages from the worker by listening for message events using the onmessage event.
If a worker throws an exception and doesn't handle the exception itself, the exception will create an event you can listen for with the onerror event.
You can determine the location of a worker from inside the worker by using the WorkerLocation object.
You can determine which navigator objects are available to the worker by using the WorkerNavigator object.
Shared workers are not supported in this release.