Table of Contents

Class CdpJSHandle

Namespace
PuppeteerSharp.Cdp
Assembly
PuppeteerSharp.dll

Supports 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.

public class CdpJSHandle : JSHandle, IJSHandle, IAsyncDisposable
Inheritance
CdpJSHandle
Implements
Extension Methods

Properties

RemoteObject

CDP remote object.

public RemoteObject RemoteObject { get; }

Property Value

RemoteObject

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public override ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

GetPropertiesAsync()

Returns a Dictionary<TKey, TValue> with property names as keys and IJSHandle instances for the property values.

public override Task<Dictionary<string, IJSHandle>> GetPropertiesAsync()

Returns

Task<Dictionary<string, IJSHandle>>

Task which resolves to a Dictionary<TKey, TValue>.

Examples

var handle = await page.EvaluateExpressionHandle("({window, document})");
var properties = await handle.GetPropertiesAsync();
var windowHandle = properties["window"];
var documentHandle = properties["document"];
await handle.DisposeAsync();

JsonValueAsync<T>()

Returns a JSON representation of the object.

public override Task<T> JsonValueAsync<T>()

Returns

Task<T>

Task.

Type Parameters

T

A strongly typed object to parse to.

Remarks

The method will return an empty JSON if the referenced object is not stringifiable. It will throw an error if the object has circular references.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.