← Chrome 147 reference

v147 · developer trial · workers · security

Document Policy in Dedicated Workers

Chrome 147 adds developer trial support for propagating Document-Policy HTTP response headers into dedicated workers. When a page is loaded with a Document Policy, the same policy now applies to workers spawned by that page, enabling consistent enforcement of security and performance constraints across the main thread and its workers.

Developer trial This API is behind a flag in Chrome 147. Enable chrome://flags/#enable-experimental-web-platform-features to try it. The API surface may change before it ships. Do not use in production.

at a glance

Status in Chrome 147Developer trial (behind a flag)
Flagenable-experimental-web-platform-features
SpecWICG Document Policy
ChromeStatus6242687411945472 — Document Policy in Dedicated Workers
Source: chromestatus.com/feature/6242687411945472

what is Document Policy?

Document Policy is an HTTP header (Document-Policy: directive=value) that allows servers to enforce or opt into behaviours for a document. Example directives include:

Previously, these policies applied only to the main document and iframes, not to workers. This extension propagates the policy to dedicated workers so that, for example, a worker that loads images or performs layout-adjacent operations respects the same constraints as the main thread.

Source: WICG Document Policy

see also