Skip to content

CdpTarget

Namespace: PuppeteerSharp.Cdp

public class CdpTarget : Target, ITarget

Target.

Inheritance: object → Target

Implements: ITarget

Derived: CdpOtherTarget, CdpPageTarget, CdpWorkerTarget

View source

public override ITarget Opener { get; }

Get the target that opened this target.

Value: ITarget

Top-level targets return null.

View source

public string TargetId { get; }

Gets the target identifier.

Value: string — The target identifier.

View source

public override TargetType Type { get; }

Gets the type. It will be Type. Can be "page", "background_page", "service_worker", "shared_worker", "browser" or "other".

Value: TargetType — The type.

View source

public override string Url { get; }

Gets the URL.

Value: string — The URL.

View source

public override Task<IPage> AsPageAsync()

Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type other as a page. If you deal with a regular page target, use PageAsync().

Returns: Task<IPage> — A task that returns a IPage.

View source

protected virtual void CheckIfInitialized()

Check is the target is not initialized.

View source

public override Task<ICDPSession> CreateCDPSessionAsync()

Creates a Chrome Devtools Protocol session attached to the target.

Returns: Task<ICDPSession> — A task that returns a ICDPSession.

View source

Made with love by Dario Kondratiuk