v157 · capabilities · exact-surface probe
Delegation probe
There is no window-side property to detect ClientPostMessageOptions.delegate — the honest probe is behavioural, and the explainer hands it to us: calling client.postMessage(msg, {delegate: 'popup'}) outside a trusted notificationclick must throw NotAllowedError in a supporting browser, while a browser without the feature ignores the unknown dictionary member and simply delivers the message. This page's service worker runs that exact call and reports what really happened.
No shipped milestone. ChromeStatus lists this as proposed (desktop: None); the Blink flag is CapabilityDelegationPopup (status experimental), enabled by launching with --enable-experimental-web-platform-features (that switch force-enables the feature per Chromium's switch-dependent overrides). The probe below tells you truthfully which world this browser is in.
1 · Service worker
Registering…
2 · The behavioural probe (service-worker side)
The worker will run, verbatim: client.postMessage({…}, { delegate: 'popup' }) — outside any notification click — and report back whether it threw.
Not run yet.
3 · Contrast: the window-side framework this extends
Window-to-window Capability Delegation already ships (payment, Chrome 107). Its sharpest observable contract: a delegate string the browser does not recognise as a delegatable capability must throw NotSupportedError — a browser without the framework ignores the unknown dictionary member instead. This button runs both calls for real: an unknown capability, and 'payment', printing each raw outcome.
why this probe shape
Anti-regression rule: a probe must be able to return false, and an ignored unknown dictionary member must never read as support. Here the two worlds produce opposite observable events — exception vs delivery — so the detection is sound. The one ambiguity is a supporting browser that threw for a different reason; that is why the raw error name and message are printed verbatim rather than reduced to a boolean.
// in the service worker, OUTSIDE notificationclick:
try {
client.postMessage(payload, { delegate: 'popup' });
// message delivered → option ignored → feature NOT implemented
} catch (e) {
// e.name === 'NotAllowedError' → feature implemented (no active token here)
}