Skip to content

Commit 144f5ee

Browse files
committed
[js] Skip silent profile installation step for Firefox
Mirrors changes made for - java in 6fc17a0 - python/ruby in 9160eab
1 parent 50e3e72 commit 144f5ee

File tree

2 files changed

+5
-35
lines changed

2 files changed

+5
-35
lines changed

javascript/node/selenium-webdriver/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
* FIXED: `remote.DriverService#start()` will now fail if the child process dies
2525
while waiting for the server to start accepting requests. Previously, start
2626
would continue to poll the server address until the timeout expired.
27+
* FIXED: Skip launching Firefox with the `-silent` flag to preheat the profile.
28+
Starting with Firefox 38, this would cause the browser to crash. This step,
29+
which was first introduced for Selenium's java client back with Firefox 2,
30+
no longer appears to be required.
2731
* FIXED: 8564: `firefox.Driver#quit()` will wait for the Firefox process to
2832
terminate before deleting the temporary webdriver profile. This eliminates a
2933
race condition where Firefox would write profile data during shutdown,

javascript/node/selenium-webdriver/firefox/binary.js

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,6 @@ function installNoFocusLibs(profileDir) {
132132
}
133133

134134

135-
/**
136-
* Silently runs Firefox to install a profile directory (which is assumed to be
137-
* defined in the given environment variables).
138-
* @param {string} firefox Path to the Firefox executable.
139-
* @param {!Object.<string, string>} env The environment variables to use.
140-
* @return {!promise.Promise} A promise for when the profile has been installed.
141-
*/
142-
function installProfile(firefox, env) {
143-
var installed = promise.defer();
144-
child.exec(firefox + ' -silent', {env: env, timeout: 180 * 1000},
145-
function(err) {
146-
if (err) {
147-
installed.reject(new Error(
148-
'Failed to install Firefox profile: ' + err));
149-
return;
150-
}
151-
installed.fulfill();
152-
});
153-
return installed.promise;
154-
}
155-
156-
157135
/**
158136
* Manages a Firefox subprocess configured for use with WebDriver.
159137
*
@@ -222,25 +200,13 @@ Binary.prototype.launch = function(profile) {
222200

223201
var args = ['-foreground'].concat(this.args_);
224202

225-
var self = this;
226-
227203
this.command_ = promise.when(this.exe_ || findFirefox(), function(firefox) {
228204
if (process.platform === 'win32' || process.platform === 'darwin') {
229-
return firefox;
205+
return exec(firefox, {args: args, env: env});
230206
}
231207
return installNoFocusLibs(profile).then(function(ldLibraryPath) {
232208
env['LD_LIBRARY_PATH'] = ldLibraryPath + ':' + env['LD_LIBRARY_PATH'];
233209
env['LD_PRELOAD'] = X_IGNORE_NO_FOCUS_LIB;
234-
return firefox;
235-
});
236-
}).then(function(firefox) {
237-
var install = exec(firefox, {args: ['-silent'], env: env});
238-
return install.result().then(function(result) {
239-
if (result.code !== 0) {
240-
throw Error(
241-
'Failed to install profile; firefox terminated with ' + result);
242-
}
243-
244210
return exec(firefox, {args: args, env: env});
245211
});
246212
});

0 commit comments

Comments
 (0)