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 packages/docs/v3/configuration/browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const stagehand = new Stagehand({
devtools: true, // Open developer tools
viewport: { width: 1280, height: 720 },
executablePath: '/opt/google/chrome/chrome', // Custom Chrome path
port: 9222, // Fixed CDP debugging port
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
Expand Down Expand Up @@ -214,6 +215,27 @@ await stagehand.init();

## Advanced Configuration

### Fixed CDP Debugging Port

Specify a fixed Chrome DevTools Protocol (CDP) debugging port instead of using a randomly assigned one.

```typescript
import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
env: "LOCAL",
localBrowserLaunchOptions: {
port: 9222,
},
});

await stagehand.init();
```

<Tip>
If no `port` is specified, a random port will be assigned.
</Tip>

### DOM Settle Timeout

Configure how long Stagehand waits for the DOM to stabilize before taking actions.
Expand Down
6 changes: 6 additions & 0 deletions packages/docs/v3/references/stagehand.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ interface V3Options {
Path to Chrome/Chromium executable.
</ParamField>

<ParamField path="port" type="number" optional>
Fixed Chrome DevTools Protocol (CDP) debugging port for external tool connections.

**Default:** Randomly assigned
</ParamField>

<ParamField path="args" type="string[]" optional>
Additional Chrome launch arguments.
</ParamField>
Expand Down