Skip to content

Commit 5e41163

Browse files
committed
Only use cloneInto for Gecko 33+
cloneInto fails up to Gecko 32 when the cloned object contains a DOM element.
1 parent 66d55c8 commit 5e41163

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

javascript/firefox-driver/js/firefoxDriver.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ FirefoxDriver.prototype.close = function(respond) {
204204
* @see https://code.google.com/p/selenium/issues/detail?id=8390
205205
*/
206206
function cloneInto(originalObject, targetScope) {
207-
// TODO: this check for FF29 and be removed when we drop support for
208-
// Firefox 24 ESR (when Firefox 38 ESR is released). Hopefully Mozilla's
209-
// Marionette will replace this entire thing by then (doubtful).
210-
if (bot.userAgent.isProductVersion(29)) {
207+
// While cloneInto was introduced with Gecko 29 and only became required in
208+
// Gecko 35, we only use it for 33+ as cloneInto fails up to Gecko 32 when
209+
// DOM elements are included in the cloned object.
210+
// TODO: this check may be removed when we drop support for Gecko 32 (when
211+
// Firefox 45 ESR is released). Hopefully Mozilla's Marionette will replace
212+
// this entire thing by then.
213+
if (bot.userAgent.isProductVersion(33)) {
211214
return Components.utils.cloneInto(originalObject, targetScope, {
212215
wrapReflectors:true
213216
});

0 commit comments

Comments
 (0)