-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[docs]: add docs for local browser port option #1606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# why Missing docs for local browser port # what changed Add documentation for the `port` option in `LocalBrowserLaunchOptions` that was added in PR #1575. This option allows users to specify a fixed Chrome CDP debugging port instead of using a randomly assigned port. Updated: - packages/docs/v3/references/stagehand.mdx - Added port parameter to LocalBrowserLaunchOptions documentation - packages/docs/v3/configuration/browser.mdx - Added port to example and new "Fixed CDP Debugging Port" section explaining the feature # test plan <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Document the port option in LocalBrowserLaunchOptions so users can set a fixed Chrome DevTools Protocol debugging port. Adds examples and guidance (including a 9222 tip) in the configuration and API reference pages. <sup>Written for commit 69f5d61. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Chromie Bot <chromie@browserbase.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant User
participant SDK as Stagehand SDK
participant Chrome as Chrome Process
Note over User,Chrome: Runtime flow for the documented "port" option
User->>SDK: new Stagehand({ localBrowserLaunchOptions: { port: 9222 } })
User->>SDK: init()
SDK->>SDK: Parse launch options
Note right of SDK: Maps "port" option to<br/>--remote-debugging-port=9222
SDK->>Chrome: Spawn process with args
alt Port 9222 Available
Chrome->>Chrome: Listen on localhost:9222
Chrome-->>SDK: PID / Process Started
SDK->>Chrome: Connect via CDP (ws://localhost:9222)
Chrome-->>SDK: Connection Established
SDK-->>User: Ready
else Port In Use (Documented Edge Case)
Chrome-->>SDK: Process Error/Exit
SDK-->>User: Error: Connection failed
end
Greptile OverviewGreptile SummaryDocuments the Changes:
The documentation accurately reflects the implementation added in PR #1575, where the port option is passed through Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Stagehand
participant V3
participant launchLocalChrome
participant ChromeLauncher
participant Chrome
User->>Stagehand: new Stagehand({env: "LOCAL", localBrowserLaunchOptions: {port: 9222}})
User->>Stagehand: await stagehand.init()
Stagehand->>V3: init() with localBrowserLaunchOptions
V3->>V3: Process launch options (flags, viewport, etc.)
V3->>launchLocalChrome: launchLocalChrome({port: 9222, chromeFlags, ...})
launchLocalChrome->>ChromeLauncher: launch({port: 9222, ...})
ChromeLauncher->>Chrome: Start Chrome with --remote-debugging-port=9222
Chrome-->>ChromeLauncher: Chrome process started
ChromeLauncher-->>launchLocalChrome: Chrome instance with fixed port
launchLocalChrome->>launchLocalChrome: waitForWebSocketDebuggerUrl(9222)
launchLocalChrome-->>V3: {ws: "ws://127.0.0.1:9222/...", chrome}
V3->>V3: Create V3Context with CDP WebSocket URL
V3-->>Stagehand: Browser initialized
Stagehand-->>User: Ready for automation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
why
Missing docs for local browser port
what changed
Add documentation for the
portoption inLocalBrowserLaunchOptionsthat was added in PR #1575. This option allows users to specify a fixed Chrome CDP debugging port instead of using a randomly assigned port.Updated:
Summary by cubic
Document the port option in LocalBrowserLaunchOptions so users can set a fixed Chrome DevTools Protocol debugging port. Adds examples and guidance (including a 9222 tip) in the configuration and API reference pages.
Written for commit 17104a6. Summary will update on new commits. Review in cubic
why
what changed
test plan