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, CommandOptions)

Protocol methods can be called with this method.

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

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.

options CommandOptions

The options.

Returns

Task<JObject>

The task.

Exceptions

PuppeteerException

If the Connection is closed.

SendAsync<T>(string, object, CommandOptions)

Protocol methods can be called with this method.

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

Parameters

method string

The method name.

args object

The method args.

options CommandOptions

The options.

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>