class ChromeOptions implements JsonSerializable (View source)

The class manages the capabilities in ChromeDriver.

Constants

CAPABILITY

The key of chromeOptions in desired capabilities

deprecated CAPABILITY_W3C

Methods

array
jsonSerialize()

Return a version of the class which can JSON serialized.

setBinary(string $path)

Sets the path of the Chrome executable. The path should be either absolute or relative to the location running ChromeDriver server.

addArguments(array $arguments)

No description

addExtensions(array $paths)

Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.

addEncodedExtensions(array $encoded_extensions)

No description

setExperimentalOption(string $name, mixed $value)

Sets an experimental option which has not exposed officially.

ArrayObject|array
toArray()

No description

Details

array jsonSerialize()

Return a version of the class which can JSON serialized.

Return Value

array

ChromeOptions setBinary(string $path)

Sets the path of the Chrome executable. The path should be either absolute or relative to the location running ChromeDriver server.

Parameters

string $path

Return Value

ChromeOptions

ChromeOptions addArguments(array $arguments)

No description

Parameters

array $arguments

Return Value

ChromeOptions

ChromeOptions addExtensions(array $paths)

Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.

Parameters

array $paths

Return Value

ChromeOptions

ChromeOptions addEncodedExtensions(array $encoded_extensions)

No description

Parameters

array $encoded_extensions

An array of base64 encoded of the extensions.

Return Value

ChromeOptions

ChromeOptions setExperimentalOption(string $name, mixed $value)

Sets an experimental option which has not exposed officially.

When using "prefs" to set Chrome preferences, please be aware they are so far not supported by Chrome running in headless mode, see https://bugs.chromium.org/p/chromium/issues/detail?id=775911

Parameters

string $name
mixed $value

Return Value

ChromeOptions

DesiredCapabilities toCapabilities()

No description

Return Value

DesiredCapabilities

The DesiredCapabilities for Chrome with this options.

ArrayObject|array toArray()

No description

Return Value

ArrayObject|array