Skip to content

Commit

Permalink
Add RTCPeerConnection constructor error to spec. (#197)
Browse files Browse the repository at this point in the history
* Add RTCPeerConnection constructor error to spec.

Because WebRTC's RTCPeerConnection interface is disallowed in
fenced frames, we need to patch the WebRTC spec to throw an exception
in the constructor.

* Address comments from lbrady
  • Loading branch information
VergeA authored Nov 8, 2024
1 parent 01cf852 commit a22434f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3918,6 +3918,24 @@ at the expense of some utility.
</wpt>
</div>

<h3 id=webrtc-monkeypatch>WebRTC</h3>

The [[WEBRTC]] specification defines "ECMAScript APIs in WebIDL to allow media and generic
application data to be sent to and received from another browser or device implementing the
appropriate set of real-time protocols." The interface which facilitates connections to peers is
{{RTCPeerConnection}}. Construction of this interface, and therefore connection to peers via
WebRTC, is disallowed in fenced frames.

<div algorithm=webrtc-constructor>
Modify the {{RTCPeerConnection}} {{RTCPeerConnection/constructor}} algorithm to add new first and
second steps that read:

1. Let |navigable| be [=this=]'s [=relevant global object=]'s [=Window/navigable=].

1. If |navigable|'s [=traversable navigable=] is a [=fenced navigable container/fenced
navigable=], throw a {{NotAllowedError}} {{DOMException}}.
</div>

<h2 id=security-and-privacy>Security & Privacy Considerations</h2>

This material is being upstreamed from our explainer into this specification, and in the meantime
Expand Down

0 comments on commit a22434f

Please sign in to comment.