-
Notifications
You must be signed in to change notification settings - Fork 798
Open
Description
Summary
Add support for custom headers when connecting to remote browsers via CDP (Chrome DevTools Protocol). This enables integration with authenticated browser services like AWS Bedrock AgentCore Browser that
require SigV4 signed headers.
Use Case
AWS Bedrock AgentCore Browser provides a managed, cloud-based browser for AI agents. It uses CDP for browser automation but requires AWS SigV4 authentication headers on the WebSocket connection:
# AWS SDK generates these headers
ws_url, headers = client.generate_ws_headers()
# headers contains: Authorization, X-Amz-Date, Host, etc.
# Playwright supports this:
browser = chromium.connect_over_cdp(ws_url, headers=headers)Currently, agent-browser connect cannot pass these headers, making it incompatible with AgentCore Browser and similar authenticated services.
Proposed Solution
Add --headers flag to the connect command:
agent-browser connect "wss://bedrock-agentcore..." --headers '{"Authorization":"AWS4-HMAC-SHA256...", "X-Amz-Date":"..."}'Technical Details
Playwright's connectOverCDP() already supports a headers option:
chromium.connectOverCDP(url, { headers: {...} })The change requires:
- Accept --headers JSON in CLI
- Pass headers to connectOverCDP() in browser.ts
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels