Contact emails [email protected]
Explainer https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DocumentPolicy/DocumentPolicyInWorkers.md Specification https://wicg.github.io/js-self-profiling/#the-profiler-interface Design docs https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DocumentPolicy/DocumentPolicyInWorkers.md Summary Allows js-profiling in dedicated workers This feature enables the JavaScript Self‑Profiling (js-profiling) API in Dedicated Workers, while remaining gated by Document Policy. It allows developers to obtain low‑overhead CPU attribution for JavaScript execution in workers, with Document Policy support for workers tracked separately. Blink component Blink>PerformanceAPIs Web Feature ID profiler Goals for experimentation None Risks Interoperability and Compatibility Low. This exposes the existing, spec-defined JS Self-Profiling Profiler API to dedicated workers behind the same Document Policy ("js-profiling") opt-in already required for documents. No new API surface or syntax is added; behavior for existing documents is unchanged. Local-scheme workers (blob:, data:, about:) inherit the creator document's Document Policy, matching HTML's policy-container inheritance rules that CSP already follows. Risk is limited to differences in whether other engines adopt Document Policy and js-profiling in workers. Gecko: No signal Firefox has not shipped JS Self-Profiling; no specific signal on the worker extension. WebKit: No signal Safari has not shipped JS Self-Profiling; no specific signal on the worker extension. Web developers: Positive Partners profiling performance-critical work offloaded to dedicated workers have asked for CPU attribution inside workers; this is the specific capability they are waiting on. Feedback thread: https://github.com/WICG/js-self-profiling/issues/33 Other signals: Ergonomics Low. Developers use the same `new Profiler({...})` / `profiler.stop()` API inside the worker. For network workers, send `Document-Policy: js-profiling` on the worker script response; for blob:/data:/about: workers, declare the policy on the creating document and it is inherited automatically (no per-worker header is possible). Activation Low. Developers use the same `new Profiler({...})` / `profiler.stop()` API inside the worker. For network workers, send `Document-Policy: js-profiling` on the worker script response; for blob:/data:/about: workers, declare the policy on the creating document and it is inherited automatically (no per-worker header is possible). Security Same profile-data exposure model as the existing document-scoped API, and gated by the same explicit Document Policy opt-in — profiling is never silently enabled. Local-scheme workers only ever inherit policy from their own creator document, so a worker cannot gain profiling capability its creator did not have. No cross-origin data is exposed that the creating context could not already profile. WebView application risks Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications? No information provided Debuggability Traces captured in a dedicated worker use the same Profiler trace format as the main thread (frames/resources/samples), so existing tooling that consumes js-self-profiling output works unchanged; results are posted back to the page via postMessage. Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)? Yes Yes. This is a Blink-level capability with no platform-specific dependencies; it applies on all platforms where dedicated workers and JS Self-Profiling are available. Is this feature fully tested by web-platform-tests? Yes https://wpt.fyi/results/js-self-profiling/with-document-policy?label=master&label=experimental&aligned&q=document-policy DevTrial instructions https://docs.google.com/document/d/1prxxuck3NDqOjuhMkT8vykV9Fl3IQyUzdESQdxz_7pg/edit?tab=t.0 Flag name on about://flags --enable-experimental-web-platform-features Finch feature name DocumentPolicyInDedicatedWorker,ProfilerAPIForDedicatedWorker Requires code in //chrome? False Tracking bug https://issues.chromium.org/issues/482085416 Estimated milestones DevTrial on desktop 154 Link to entry on the Chrome Platform Status https://chromestatus.com/feature/5159559872249856 Links to previous Intent discussions Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/69975252.050a0220.1f729.0da6.GAE%40google.com This intent message was generated by Chrome Platform Status. -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6aa31121.90f85c51.384d69.0161.GAE%40google.com.
