CdpCDPSession
Namespace: PuppeteerSharp.Cdp
public class CdpCDPSession : CDPSession, ICDPSession, ICDPConnectionSupports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Inheritance: object → CDPSession
Implements: ICDPSession, ICDPConnection
Properties
Section titled “Properties”Detached
Section titled “Detached”public override bool Detached { get; }True if the session has been detached, false otherwise.
Value: bool
Methods
Section titled “Methods”Close(string)
Section titled “Close(string)”public override void Close(string closeReason)Closes the session.
Parameters
| Name | Type | Description |
|---|---|---|
closeReason |
string | The close reason. |
DetachAsync()
Section titled “DetachAsync()”public override Task DetachAsync()Detaches session from target. Once detached, session won’t emit any events and can’t be used to send messages.
Returns: Task — A Task that when awaited detaches from the session target.
Exceptions
| Type | Condition |
|---|---|
| PuppeteerException | If the Connection is closed. |
SendAsync(string, object, bool, CommandOptions)
Section titled “SendAsync(string, object, bool, CommandOptions)”public override Task<JsonElement?> SendAsync(string method, object args = null, bool waitForCallback = true, CommandOptions options = null)Protocol methods can be called with this method.
Parameters
| Name | Type | Description |
|---|---|---|
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<JsonElement?> — The task.
Exceptions
| Type | Condition |
|---|---|
| PuppeteerException | If the Connection is closed. |
Made with love by Dario Kondratiuk