-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[docs]: add Playwriter integration for controlling existing browser #1383
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
base: main
Are you sure you want to change the base?
Conversation
|
Greptile OverviewGreptile SummaryAdded comprehensive documentation for the Playwriter Chrome extension integration, enabling users to control their existing browser with Stagehand instead of launching a new instance. Key additions:
The documentation follows established patterns from other integration pages (Playwright, Puppeteer, Selenium) and provides clear, actionable guidance for users wanting to automate their existing browser sessions. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Browser as Chrome Browser
participant Extension as Playwriter Extension
participant Relay as CDP Relay Server
participant Script as Stagehand Script
User->>Extension: Click extension icon on tab
Extension->>Extension: Connect to tab via CDP
Extension-->>User: Show green icon (connected)
Script->>Relay: startPlayWriterCDPRelayServer()
Relay->>Relay: Start server on port 19988
Script->>Relay: getCdpUrl()
Relay-->>Script: CDP WebSocket URL
Script->>Script: Initialize Stagehand with cdpUrl
Script->>Relay: Connect via CDP WebSocket
Relay->>Extension: Forward CDP commands
Extension->>Browser: Execute commands on connected tab
Browser-->>Extension: Return results
Extension->>Relay: Forward results
Relay-->>Script: Return results to Stagehand
Script->>Relay: page.goto("https://example.com")
Relay->>Extension: Forward navigation command
Extension->>Browser: Navigate tab
Browser-->>Script: Navigation complete
Script->>Relay: page.locator().click()
Relay->>Extension: Forward click command
Extension->>Browser: Execute click
Browser-->>Script: Action complete
|
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.
2 files reviewed, no comments
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
31d789d to
09cd71b
Compare
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.
Pull request overview
This PR adds comprehensive documentation for the Playwriter integration, which enables users to control their existing Chrome browser with Stagehand instead of launching a new browser instance. This integration is particularly useful for scenarios requiring existing browser sessions, extensions, or manual CAPTCHA solving.
Key Changes:
- Added new integration documentation file explaining Playwriter setup and usage
- Updated navigation configuration to include Playwriter in the integrations section
- Documented the relay server approach for connecting Stagehand to existing Chrome tabs via CDP
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/docs/v3/integrations/playwriter.mdx | New documentation page covering Playwriter integration overview, installation steps, code example, troubleshooting, and comparison with standard Stagehand |
| packages/docs/docs.json | Added playwriter to integrations navigation in alphabetical order between playwright and puppeteer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
why
what changed
packages/docs/v3/integrations/playwriter.mdxwith installation, example, and troubleshootingpackages/docs/docs.jsonto include Playwriter in the integrations navtest plan
Summary by cubic
Added docs for the Playwriter integration to control an existing Chrome session with Stagehand via CDP. Includes install steps, a TypeScript example, extension states, troubleshooting, and a new entry in the Integrations nav.
Written for commit 09cd71b. Summary will update automatically on new commits.