ChromeOptions
in package
implements
JsonSerializable
The class manages the capabilities in ChromeDriver.
Tags
Table of Contents
Interfaces
- JsonSerializable
Constants
- CAPABILITY = 'goog:chromeOptions'
- The key of chromeOptions in desired capabilities
- CAPABILITY_W3C = self::CAPABILITY
Properties
- $arguments : array<string|int, mixed>
- $binary : string
- $experimentalOptions : array<string|int, mixed>
- $extensions : array<string|int, mixed>
Methods
- addArguments() : ChromeOptions
- addEncodedExtensions() : ChromeOptions
- addExtensions() : ChromeOptions
- Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.
- jsonSerialize() : array<string|int, mixed>
- Return a version of the class which can JSON serialized.
- setBinary() : ChromeOptions
- Sets the path of the Chrome executable. The path should be either absolute or relative to the location running ChromeDriver server.
- setExperimentalOption() : ChromeOptions
- Sets an experimental option which has not exposed officially.
- toArray() : ArrayObject|array<string|int, mixed>
- toCapabilities() : DesiredCapabilities
- addEncodedExtension() : ChromeOptions
- addExtension() : ChromeOptions
- Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.
Constants
CAPABILITY
The key of chromeOptions in desired capabilities
public
mixed
CAPABILITY
= 'goog:chromeOptions'
CAPABILITY_W3C
public
mixed
CAPABILITY_W3C
= self::CAPABILITY
Tags
Properties
$arguments
private
array<string|int, mixed>
$arguments
= []
$binary
private
string
$binary
= ''
$experimentalOptions
private
array<string|int, mixed>
$experimentalOptions
= []
$extensions
private
array<string|int, mixed>
$extensions
= []
Methods
addArguments()
public
addArguments(array<string|int, mixed> $arguments) : ChromeOptions
Parameters
- $arguments : array<string|int, mixed>
Return values
ChromeOptionsaddEncodedExtensions()
public
addEncodedExtensions(array<string|int, mixed> $encoded_extensions) : ChromeOptions
Parameters
- $encoded_extensions : array<string|int, mixed>
-
An array of base64 encoded of the extensions.
Return values
ChromeOptionsaddExtensions()
Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.
public
addExtensions(array<string|int, mixed> $paths) : ChromeOptions
Parameters
- $paths : array<string|int, mixed>
Return values
ChromeOptionsjsonSerialize()
Return a version of the class which can JSON serialized.
public
jsonSerialize() : array<string|int, mixed>
Attributes
Return values
array<string|int, mixed>setBinary()
Sets the path of the Chrome executable. The path should be either absolute or relative to the location running ChromeDriver server.
public
setBinary(string $path) : ChromeOptions
Parameters
- $path : string
Return values
ChromeOptionssetExperimentalOption()
Sets an experimental option which has not exposed officially.
public
setExperimentalOption(string $name, mixed $value) : ChromeOptions
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
- $name : string
- $value : mixed
Return values
ChromeOptionstoArray()
public
toArray() : ArrayObject|array<string|int, mixed>
Return values
ArrayObject|array<string|int, mixed>toCapabilities()
public
toCapabilities() : DesiredCapabilities
Return values
DesiredCapabilities —The DesiredCapabilities for Chrome with this options.
addEncodedExtension()
private
addEncodedExtension(string $encoded_extension) : ChromeOptions
Parameters
- $encoded_extension : string
-
Base64 encoded of the extension.
Return values
ChromeOptionsaddExtension()
Add a Chrome extension to install on browser startup. Each path should be a packed Chrome extension.
private
addExtension(string $path) : ChromeOptions
Parameters
- $path : string