Skip to main content
Version: v2

Advanced Hybrid Automations

Advanced Configurations

Stream Quality and Performance

Control bandwidth usage and visual quality based on your needs:

const { liveURL } = await cdp.send('Browserless.liveURL', {
quality: 50, // 1-100, lower = less bandwidth
type: 'jpeg', // 'jpeg' or 'png'
timeout: 60000, // Session timeout in milliseconds
});

Viewport and Interaction Control

const { liveURL } = await cdp.send('Browserless.liveURL', {
resizable: false, // Maintain fixed viewport
interactable: true, // Allow user interaction
showBrowserInterface: false, // Show/hide browser tabs and UI
});

Event Handling

Listen for important events during the session:

// Detect CAPTCHA challenges
cdp.on('Browserless.captchaFound', () => {
console.log('CAPTCHA detected - user intervention needed');
});

// Session completion
cdp.on('Browserless.liveComplete', () => {
console.log('User closed the session');
});

Programmatic Session Control

Manage sessions programmatically for precise control:

// Get both URL and ID for programmatic control
const { liveURL, liveURLId } = await cdp.send('Browserless.liveURL');

// Wait for specific condition
await page.waitForSelector('.success-indicator');

// Programmatically close the session
await cdp.send('Browserless.closeLiveURL', { liveURLId });

Read-Only Sessions

Create view-only sessions for monitoring or demonstrations:

const { liveURL } = await cdp.send('Browserless.liveURL', {
interactable: false, // Users can only view, not interact
quality: 80,
});

Best Practices

Security Considerations

  • LiveURLs contain no API tokens - safe to share externally
  • Set appropriate timeouts to limit session duration
  • Use interactable: false for view-only scenarios

Performance Optimization

  • Use quality: 30-50 for mobile devices or slow connections
  • Choose type: 'jpeg' for better compression
  • Set reasonable timeouts to prevent resource waste

Error Handling

  • Always implement proper cleanup in try/finally blocks
  • Listen for Browserless.liveComplete events to detect early termination
  • Handle network interruptions gracefully