Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ $screenshot = $client->sessions()->action($sessionId, 'screenshot', ['fullPage'
$client->sessions()->close($sessionId);
```

### CDP Sessions

To create a session with a Chrome DevTools Protocol (CDP) connection, pass
`['cdp' => true]` when creating the browser session. The response includes a
connection URL on the returned session object:

```php
$created = $client->sessions()->create([
'maxTtlSeconds' => 300,
'cdp' => true,
]);

$session = $created['session'];
$connectUrl = $session['connectUrl'];

echo $connectUrl;

$client->sessions()->close($session['id']);
```

CDP sessions cannot be combined with `proxy` or `bypassBotDetection` options.

## Configuration Options

### Constructor Options
Expand Down
3 changes: 2 additions & 1 deletion src/CaptureSessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function __construct(
}

/**
* @param array<string, mixed> $options
* @param array<string, mixed> $options Browser session options,
* for example ['maxTtlSeconds' => 300, 'cdp' => true].
* @return array<string, mixed>
*/
public function create(array $options = []): array
Expand Down