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<JsonElement?> SendAsync(string method, object args = null, bool waitForCallback = true, CommandOptions options = null)
Parameters
method
stringThe method name.
args
objectThe method args.
waitForCallback
boolIf
true
the method will return a task to be completed when the message is confirmed by Chromium. Iffalse
the task will be considered complete after sending the message to Chromium.options
CommandOptionsThe options.
Returns
- Task<JsonElement?>
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
stringThe method name.
args
objectThe method args.
options
CommandOptionsThe options.
Returns
- Task<T>
The task.
Type Parameters
T
Return type.
Events
MessageReceived
Occurs when message received from Chromium.
event EventHandler<MessageEventArgs> MessageReceived