Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: inject.preload.js

Issue 29445594: Noissue - Fix some problems Firefox has with our injected code (Closed)
Patch Set: Created May 22, 2017, 10:31 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: inject.preload.js
diff --git a/inject.preload.js b/inject.preload.js
index ce6912136372870d2e7c3510994e6e05c3198984..f5e1d476b31d65cb783005344c59e4710ed03f3b 100644
--- a/inject.preload.js
+++ b/inject.preload.js
@@ -174,8 +174,9 @@ function injected(eventName, injectedIntoContentWindow)
{
for (let name of properties)
{
- Object.defineProperty(dest, name,
- Object.getOwnPropertyDescriptor(src, name));
+ let descriptor = Object.getOwnPropertyDescriptor(src, name);
+ if (descriptor)
+ Object.defineProperty(dest, name, descriptor);
}
}
@@ -358,11 +359,17 @@ function injected(eventName, injectedIntoContentWindow)
if (!(this instanceof WrappedRTCPeerConnection))
return WrappedRTCPeerConnection();
+
let configuration = protectConfiguration(args[0]);
+
// 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld