# Class selenium-webdriver/chrome.Options

code »

Class for managing ChromeDriver specific options.

## Constructor

Options ( )
Show:Public Protected Private

## Instance Methods

code »addArguments ( var_args ) ⇒ `!Options`

Add additional command line arguments to use when launching the Chrome browser. Each argument may be specified with or without the "--" prefix (e.g. "--foo" and "foo"). Arguments with an associated value should be delimited by an "=": "foo=bar".

Parameters
var_args: `...(string|!Array.<string>)` The arguments to add.
Returns
A self reference.

code »addExtensions ( var_args ) ⇒ `!Options`

Add additional extensions to install when launching Chrome. Each extension should be specified as the path to the packed CRX file, or a Buffer for an extension.

Parameters
var_args: `...(string|!Buffer|!Array)` The extensions to add.
Returns
A self reference.

code »detachDriver ( detach ) ⇒ `!Options`

Sets whether to leave the started Chrome browser running if the controlling ChromeDriver service is killed before `webdriver.WebDriver#quit()` is called.

Parameters
detach: `boolean` Whether to leave the browser running if the chromedriver service is killed before the session.
Returns
A self reference.

code »setChromeBinaryPath ( path ) ⇒ `!Options`

Sets the path to the Chrome binary to use. On Mac OS X, this path should reference the actual Chrome executable, not just the application binary (e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"). The binary path be absolute or relative to the chromedriver server executable, but it must exist on the machine that will launch Chrome.

Parameters
path: `string` The path to the Chrome binary to use.
Returns
A self reference.

code »setChromeLogFile ( path ) ⇒ `!Options`

Sets the path to Chrome's log file. This path should exist on the machine that will launch Chrome.

Parameters
path: `string` Path to the log file to use.
Returns
A self reference.

code »setLocalState ( state ) ⇒ `!Options`

Sets preferences for the "Local State" file in Chrome's user data directory.

Parameters
state: `!Object` Dictionary of local state preferences.
Returns
A self reference.

code »setLoggingPrefs ( prefs ) ⇒ `!Options`

Sets the logging preferences for the new session.

Parameters
prefs: `!webdriver.logging.Preferences` The logging preferences.
Returns
A self reference.

code »setProxy ( proxy ) ⇒ `!Options`

Sets the proxy settings for the new session.

Parameters
proxy: `webdriver.ProxyConfig` The proxy configuration to use.
Returns
A self reference.

code »setUserPreferences ( prefs ) ⇒ `!Options`

Sets the user preferences for Chrome's user profile. See the "Preferences" file in Chrome's user data directory for examples.

Parameters
prefs: `!Object` Dictionary of user preferences to use.
Returns
A self reference.

code »toCapabilities ( opt_capabilities ) ⇒ `!webdriver.Capabilities`

Converts this options instance to a `webdriver.Capabilities` object.

Parameters
opt_capabilities: `webdriver.Capabilities=` The capabilities to merge these options into, if any.
Returns
The capabilities.

code »toJSON ( ) ⇒ `{args: !Array.<string>, binary: (string|undefined), detach: boolean, extensions: !Array.<string>, localState: (Object|undefined), logFile: (string|undefined), prefs: (Object|undefined)}`

Converts this instance to its JSON wire protocol representation. Note this function is an implementation not intended for general use.

Returns
The JSON wire protocol representation of this instance.

## Instance Properties

code »args_ : `!Array.<string>`
code »extensions_ : `!Array`

## Static Functions

code »selenium-webdriver/chrome.Options.fromCapabilities ( capabilities ) ⇒ `!Options`

Extracts the ChromeDriver specific options from the given capabilities object.

Parameters
capabilities: `!webdriver.Capabilities` The capabilities object.
Returns
The ChromeDriver options.