Browser
Browser Sessions provide direct access to Chrome browsers via DevTools Protocol (CDP), enabling advanced automation and custom browser control.
What is a Browser Session?
A raw browser instance with:
- CDP URL: Direct Chrome DevTools Protocol access
- Live URL: Real-time browser viewing
- Timeout-based lifecycle: Automatic cleanup after inactivity
- Profile support: Inherit saved browser state
Unlike AI agent sessions, browser sessions give you direct programmatic control.
Key Properties
id
: Unique browser session identifierstatus
:"active"
or"stopped"
cdpUrl
: Chrome DevTools Protocol URL for automationliveUrl
: Real-time browser viewing URLtimeoutAt
: When the session will automatically stop
Creating Browser Sessions
Using CDP for Automation
Managing Browser Sessions
Automation Libraries
Browser sessions work with any CDP-compatible automation library:
Playwright:
Puppeteer:
Selenium:
Browser vs Agent Sessions
Browser Sessions (Direct Control):
- Raw CDP access for custom automation
- Use your own automation scripts
- Full control over browser behavior
- Requires programming automation logic
Agent Sessions (AI-Powered):
- AI agent executes natural language instructions
- Separate AI-powered automation system
- Automatic task completion
- No programming required
Common Use Cases
Custom Automation Workflows:
Integration Testing:
Web Scraping with State:
Best Practices
Session Management:
- Set appropriate timeouts based on task duration
- Always stop sessions when done to free resources
- Use profiles to preserve login state across sessions
Automation:
- Handle network errors and timeouts gracefully
- Use explicit waits for dynamic content
- Take screenshots for debugging
Performance:
- Reuse profiles to avoid repeated login flows
- Close sessions promptly to avoid timeout charges
- Use appropriate proxy locations for target websites
Security:
- Don’t expose CDP URLs publicly
- Use profiles to isolate different users
- Monitor session usage for suspicious activity