# Class selenium-webdriver/firefox/profile.Profile

code »

Models a Firefox proifle directory for use with the FirefoxDriver. The `Proifle` directory uses an in-memory model until `#writeToDisk` is called.

## Constructor

Profile ( opt_dir )

Parameters
opt_dir: `string=` Path to an existing Firefox profile directory to use a template for this profile. If not specified, a blank profile will be used.

Show:Public Protected Private

## Instance Methods

code »acceptUntrustedCerts ( ) ⇒ `boolean`

Returns
Whether the FirefoxDriver is configured to automatically accept untrusted SSL certificates.

code »addExtension ( extension )

Registers an extension to be included with this profile.

Parameters
extension: `string` Path to the extension to include, as either an unpacked extension directory or the path to a xpi file.

code »assumeUntrustedCertIssuer ( ) ⇒ `boolean`

Returns
Whether to assume untrusted certs come from untrusted issuers.

code »encode ( ) ⇒ `!promise.Promise.<string>`

Encodes this profile as a zipped, base64 encoded directory.

Returns
A promise for the encoded profile.

code »getPort ( ) ⇒ `number`

Returns
The port this profile is currently configured to use, or 0 if the port will be selected at random when the profile is written to disk.

code »getPreference ( key ) ⇒ `(string|number|boolean|undefined)`

Returns the currently configured value of a profile preference. This does not include any defaults defined in the profile's template directory user.js file (if a template were specified on construction).

Parameters
key: `string` The desired preference.
Returns
The current value of the requested preference.

code »nativeEventsEnabled ( ) ⇒ `boolean`

Returns whether native events are enabled in this profile.

Returns
.

code »setAcceptUntrustedCerts ( value )

Sets whether the FirefoxDriver should automatically accept untrusted SSL certificates.

Parameters
value: `boolean` .

code »setAssumeUntrustedCertIssuer ( value )

Sets whether to assume untrusted certificates come from untrusted issuers.

Parameters
value: `boolean` .

code »setNativeEventsEnabled ( enabled )

Sets whether to use native events with this profile.

Parameters
enabled: `boolean` .

code »setPort ( port )

Sets the port to use for the WebDriver extension loaded by this profile.

Parameters
port: `number` The desired port, or 0 to use any free port.

code »setPreference ( key, value )

Sets a desired preference for this profile.

Parameters
key: `string` The preference key. value: `(string|number|boolean)` The preference value.
Throws
`Error` If attempting to set a frozen preference.

code »writeToDisk ( opt_excludeWebDriverExt ) ⇒ `!promise.Promise.<string>`

Writes this profile to disk.

Parameters
opt_excludeWebDriverExt: `boolean=` Whether to exclude the WebDriver extension from the generated profile. Used to reduce the size of an `encoded profile` since the server will always install the extension itself.
Returns
A promise for the path to the new profile directory.

## Instance Properties

code »extensions_ : `!Array.<string>`
code »nativeEventsEnabled_ : `boolean`
code »port_ : `number`
code »preferences_ : `!Object`
code »template_ : `(string|undefined)`