Table of Contents

Interface ICDPConnection

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

An ICDPConnection is an object able to send and receive messages from the browser.

public interface ICDPConnection

Methods

SendAsync(string, object, bool)

Protocol methods can be called with this method.

Task<JObject> SendAsync(string method, object args = null, bool waitForCallback = true)

Parameters

method string

The method name.

args object

The method args.

waitForCallback bool

If true the method will return a task to be completed when the message is confirmed by Chromium. If false the task will be considered complete after sending the message to Chromium.

Returns

Task<JObject>

The task.

Exceptions

PuppeteerException

If the Connection is closed.

SendAsync<T>(string, object)

Protocol methods can be called with this method.

Task<T> SendAsync<T>(string method, object args = null)

Parameters

method string

The method name.

args object

The method args.

Returns

Task<T>

The task.

Type Parameters

T

Return type.

Events

MessageReceived

Occurs when message received from Chromium.

event EventHandler<MessageEventArgs> MessageReceived

Event Type

EventHandler<MessageEventArgs>