[webrtc-pc] Expose RTCPeerConnection and related WebRTC types to Workers ([Exposed=(Window,Worker)]) (#3131)

BigTava has just created a new issue for https://github.com/w3c/webrtc-pc:

== Expose RTCPeerConnection and related WebRTC types to Workers ([Exposed=(Window,Worker)]) ==
### Request

Change `[Exposed=Window]` to `[Exposed=(Window,Worker)]` on `RTCPeerConnection` and the related WebRTC PeerConnection types, so the API is usable from Worker and SharedWorker global scopes (as IndexedDB, WebSocket, and fetch already are).

### Use case: browser-based light clients

P2P light clients (e.g. smoldot, used by Polkadot/Substrate) use WebRTC (webrtc-direct) as a libp2p transport to dial network nodes directly from the browser. Two properties matter for them: they run block verification in a Worker to keep the main thread responsive, and they share a single light-client instance across tabs via a SharedWorker instead of each tab warp-syncing its own.

Both require WebRTC inside a Worker. Because `RTCPeerConnection` is Window-only, the light client either runs on the main thread or resorts to an elected-leader iframe that hands the connection between tabs, which is brittle and breaks apps mid-session on handoff.

### Prior art

- w3c/webrtc-pc#2553 requested this and was redirected to the NV use-cases repo.
- w3c/webrtc-nv-use-cases#60 is the resulting thread, open but dormant since 2020.

Filing here as a concrete spec-IDL request rather than a use case. Service Worker lifetime is a separate concern, the immediate ask is Dedicated and Shared Workers.

### Precedent

IndexedDB, WebSocket, and fetch are all `[Exposed=(Window,Worker)]`.


Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/3131 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 29 July 2026 16:00:28 UTC