PuppeteerClient

PuppeteerCommunicator - The CDP Transport Layer

PuppeteerCommunicator is the lowest-level layer in GPAL's browser stack - a managed websocket connection that speaks the Chrome DevTools Protocol directly, used internally by PuppeteerClient and the Puppeteer-based automation engines.

PuppeteerCommunicator is the lowest-level layer in GPAL's browser stack - a managed websocket connection that speaks the Chrome DevTools Protocol directly, used internally by PuppeteerClient and the Puppeteer-based automation engines.

PuppeteerCommunicator owns the websocket (or pipe) connection to the browser's DevTools endpoint, tracks frame/context/session IDs, queues CDP events, and matches asynchronous CDP responses back to the calls that requested them. browser.PuppeteerCommunicator exposes this connection on a live Browser instance using a Puppeteer-based engine (PuppeteerPort, PuppeteerPortHW, PuppeteerPipe, PuppeteerPipeHW). PuppeteerClient is built on top of PuppeteerCommunicator - every PuppeteerClient endpoint ultimately becomes one or more raw CDP commands sent through PuppeteerCommunicator and resolved against its response/event queues. Like PuppeteerClient, this is a completely custom CDP implementation written for GPAL - not derived from, or dependent on, the Node.js Puppeteer library or any third-party .NET Puppeteer package.

TIP

Most workflows never touch PuppeteerCommunicator directly - PuppeteerClient and the Browser fluent API cover the vast majority of CDP operations. Reach for PuppeteerCommunicator only when you need a CDP domain/method that has no PuppeteerClient endpoint yet, or when building new PuppeteerClient endpoint mappings.

WARNING

PuppeteerCommunicator's members are largely internal and intended for extending GPAL itself rather than for application workflows. Method signatures here may change between releases without the same compatibility guarantees as the Browser, RESTClient, and PuppeteerClient fluent APIs.

Examples

GPAL Fluent: High-level fluent C# API

//PuppeteerCommunicator manages one websocket session per Browser, including target/session switching for tabs, windows, iframes, and shadow DOM. PuppeteerClient endpoint implementations call PuppeteerCommunicator's methods (such as QuerySelector, Click, Evaluate at the CDP level) and translate the raw CDP responses into the values PuppeteerClient.Execute returns.

// Accessing the underlying CDP connection from a live Browser var browser = GPAL.Browser .WithUseAutomationEngine(AutomationEngine.PuppeteerPort) .GoTo("https://example.com") .ToGPALObject(); var communicator = browser.PuppeteerCommunicator; // PuppeteerClient endpoint calls run through this same connection string elementId = browser.PuppeteerClient .QuerySelector("#main") .Execute();