How to expose the Connection from CdpBrowserContext in Puppeteer

Puppeteer

Summary

This change adds a public getter to CdpBrowserContext to expose the internal Connection object. It returns the private #connection while preserving encapsulation.

How to use

// Assuming you have a CdpBrowserContext instance
const connection = cdpBrowserContext.connection; // Connection
// Example: send a direct CDP command
await connection.send('Target.setAutoAttach', { /* options */ });

Details

  • This is an additive change that does not modify existing APIs.
  • No external documentation updates are required for this internal API addition.