HumHub Documentation (unofficial)

ChromeOptions
in package
implements JsonSerializable

The class manages the capabilities in ChromeDriver.

Tags
see
https://sites.google.com/a/chromium.org/chromedriver/capabilities

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
deprecated

Use CAPABILITY instead

Properties

$experimentalOptions

private array<string|int, mixed> $experimentalOptions = []

$extensions

private array<string|int, mixed> $extensions = []

Methods

addEncodedExtensions()

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
ChromeOptions

addExtensions()

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
ChromeOptions

jsonSerialize()

Return a version of the class which can JSON serialized.

public jsonSerialize() : array<string|int, mixed>
Attributes
#[ReturnTypeWillChange]
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
ChromeOptions

setExperimentalOption()

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
ChromeOptions

toArray()

public toArray() : ArrayObject|array<string|int, mixed>
Return values
ArrayObject|array<string|int, mixed>

addEncodedExtension()

private addEncodedExtension(string $encoded_extension) : ChromeOptions
Parameters
$encoded_extension : string

Base64 encoded of the extension.

Return values
ChromeOptions

addExtension()

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
Return values
ChromeOptions

        
On this page

Search results