Index: inject.preload.js |
diff --git a/inject.preload.js b/inject.preload.js |
index ce6912136372870d2e7c3510994e6e05c3198984..c060e2cc730d093ce14e65683322954ff7834e16 100644 |
--- a/inject.preload.js |
+++ b/inject.preload.js |
@@ -359,10 +359,15 @@ function injected(eventName, injectedIntoContentWindow) |
return WrappedRTCPeerConnection(); |
let configuration = protectConfiguration(args[0]); |
Sebastian Noack
2017/05/22 12:16:54
Nit: Perhaps move this definition below where the
kzar
2017/05/22 13:02:04
Mmh I think it's OK here personally.
|
+ |
// Since the old webkitRTCPeerConnection constructor takes an optional |
// second argument we need to take care to pass that through. Necessary |
// for older versions of Chrome such as 49. |
- let peerconnection = new RealRTCPeerConnection(configuration, args[1]); |
+ let constraints = undefined; |
+ if (args.length > 1) |
+ constraints = args[1]; |
+ |
+ let peerconnection = new RealRTCPeerConnection(configuration, constraints); |
checkConfiguration(peerconnection, configuration); |
return peerconnection; |
} |
@@ -371,7 +376,7 @@ function injected(eventName, injectedIntoContentWindow) |
let boundWrappedRTCPeerConnection = WrappedRTCPeerConnection.bind(); |
copyProperties(RealRTCPeerConnection, boundWrappedRTCPeerConnection, |
- ["caller", "generateCertificate", "name", "prototype"]); |
+ ["generateCertificate", "name", "prototype"]); |
RealRTCPeerConnection.prototype.constructor = boundWrappedRTCPeerConnection; |
if ("RTCPeerConnection" in window) |