File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed
javascript/node/selenium-webdriver/firefox Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,12 @@ class Driver extends webdriver.WebDriver {
354
354
binary = new Binary ( binary ) ;
355
355
}
356
356
357
+ let profile = new Profile ( ) ;
358
+ if ( caps . has ( Capability . PROFILE ) ) {
359
+ profile = caps . get ( Capability . PROFILE ) ;
360
+ caps . delete ( Capability . PROFILE ) ;
361
+ }
362
+
357
363
let serverUrl , onQuit ;
358
364
359
365
// Users must now explicitly disable marionette to use the legacy
@@ -367,14 +373,9 @@ class Driver extends webdriver.WebDriver {
367
373
let service = createGeckoDriverService ( binary ) ;
368
374
serverUrl = service . start ( ) ;
369
375
onQuit = ( ) => service . kill ( ) ;
376
+ caps . set ( Capability . PROFILE , profile . encode ( ) ) ;
370
377
371
378
} else {
372
- let profile = new Profile ;
373
- if ( caps . has ( Capability . PROFILE ) ) {
374
- profile = caps . get ( Capability . PROFILE ) ;
375
- caps . delete ( Capability . PROFILE ) ;
376
- }
377
-
378
379
let freePort = portprober . findFreePort ( ) ;
379
380
let preparedProfile =
380
381
freePort . then ( port => prepareProfile ( profile , port ) ) ;
Original file line number Diff line number Diff line change @@ -188,8 +188,8 @@ function decode(data) {
188
188
189
189
/**
190
190
* Models a Firefox profile directory for use with the FirefoxDriver. The
191
- * {@code Profile} directory uses an in-memory model until { @link #writeToDisk}
192
- * is called.
191
+ * {@code Profile} directory uses an in-memory model until
192
+ * { @link #writeToDisk} or { @link #encode} is called.
193
193
*/
194
194
class Profile {
195
195
/**
@@ -366,8 +366,12 @@ class Profile {
366
366
}
367
367
368
368
/**
369
- * Encodes this profile as a zipped, base64 encoded directory.
370
- * @return {!Promise<string> } A promise for the encoded profile.
369
+ * Write profile to disk, compress its containing directory, and return
370
+ * it as a Base64 encoded string.
371
+ *
372
+ * @return {!Promise<string> } A promise for the encoded profile as
373
+ * Base64 string.
374
+ *
371
375
*/
372
376
encode ( ) {
373
377
return this . writeToDisk ( true ) . then ( function ( dir ) {
You can’t perform that action at this time.
0 commit comments