← Back to release summary

WorkerOptions for shared workers constructor

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 81)
Intent stage
None

Summary

Adds the WorkerOptions object as the second argument for a shared worker constructor. The previous second argument, a DOMString containing the worker’s name is still supported.

Motivation

WorkerOptions is necessary for implementing the new feature (ES module).

Standards & signals

Explainers: https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface https://html.spec.whatwg.org/multipage/workers.html#workeroptions

View on chromestatus.com