v157 · javascript · service workers

Which scopes have it

Four realms, one question: can ProgressEvent be constructed here? Every cell below is a live construction attempt inside that realm — a dedicated worker, a shared worker and a service worker each run the same three lines and report back. The gap this feature closes shows up as one row differing from the other three.

Ready. Nothing has been probed yet.

Probe every realm

ProgressEvent availability probed in four JavaScript realms
realm ProgressEvent exposed constructed loaded / total read back
Windownot probed——
DedicatedWorkernot probed——
SharedWorkernot probed——
ServiceWorkerGlobalScopenot probed——
Press the button to run all four probes.

the same three lines, four times

// Run verbatim inside each realm — not inferred from the page.
const exposed = typeof ProgressEvent === "function";
const e = exposed
  ? new ProgressEvent("progress", { lengthComputable: true, loaded: 512, total: 2048 })
  : null;
report({ exposed, loaded: e && e.loaded, total: e && e.total });

The dedicated and shared workers are built from a Blob URL so there is no extra file to fetch; the service worker has to be a real same-origin script, so it lives beside this page. None of the four results is a lookup table — each is what that realm reported about itself.

reading the result

Before Chrome 157, the expected shape is three rows saying exposed and the service worker row saying not exposed. That single difference is the whole feature: ProgressEvent comes from the XMLHttpRequest Standard, whose [Exposed] list historically covered the realms that have XHR, and service workers never did.

From Chrome 157 all four rows agree. If a realm fails to report at all — a blocked worker, an insecure context, a registration error — the row says so rather than being coloured in as a negative result; an unreachable realm is not the same finding as an unsupported one.

see also