v150 · WebRTC

WebRTC Diagnostic Logging API

A small API — navigator.rtc.startDiagnosticLogging(), finishDiagnosticLogging(), cancelDiagnosticLogging() — that lets an authorized app ask the browser to record internal WebRTC diagnostics to a local log file. Logs are never exposed to the page; the app only receives a session ID it can attach to a bug report. Optionally the user can authorize uploading the log to the browser vendor.

concepts

  1. Logging lifecycle

    Drive the three-state machine with real calls: start returns a UUID session ID, finish finalises the local log, cancel discards it. Watch the session ID appear and the state transition live, with each button enabled only when it's valid to call.

  2. Bug-report companion

    The real-world use case: start a session with allowUpload and structured metadata, then hand the returned ID to a bug report. Includes the spec's metadata limits — at most 5 entries, each key/value ≤ 100 chars — and shows the RangeError Chromium currently throws when you exceed them (the WICG spec mandates a TypeError; a live spec/implementation divergence).

  3. Capability & policy probe

    Feature-detect navigator.rtc and each method, and understand the full gate: an origin trial or the RTCDiagnosticLogging flag exposes the API, while production deployment additionally needs the enterprise policy WebRtcDiagnosticLogCollectionAllowedForOrigins. Honest reporting — no fake success when the API is absent.

why it shipped

WebRTC calls fail in ways that are painful to reproduce: NAT traversal quirks, codec negotiation, packet loss, jitter — all buried in the browser's internal state. Chrome has long had chrome://webrtc-internals and an internal event-logging pipeline, but a web app couldn't trigger a capture around a user-reported problem or correlate it with its own bug report. This API gives authorized apps a programmatic hook to start a capture, tag it with app metadata, and get back an ID — the same pattern as crash IDs — so a support engineer can line the browser's diagnostics up with the app's own logs. Critically, the diagnostics never flow back into the page, preserving user privacy.

enabling it

Origin trial on desktop, Chrome 150–155; the feature detail (chromestatus API, updated 2026-06-25) estimates desktop shipping at 156 with status text “Proposed”. ChromeStatus lists no public trial registration as of 2026-07-24 — the trial is enterprise-oriented: per the blink-dev intent to experiment, diagnostic logs are enabled via the enterprise policy WebRtcDiagnosticLogCollectionAllowedForOrigins. To run locally today, launch Chrome with --enable-blink-features=RTCDiagnosticLogging or turn on chrome://flags/#enable-experimental-web-platform-features. The navigator.rtc interface requires a secure context. For a real deployment the enterprise policy must also list the origin. Every demo here feature-detects and shows these exact steps when the API is missing.

references

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗