CdpTarget
Namespace: PuppeteerSharp.Cdp
public class CdpTarget : Target, ITargetTarget.
Implements: ITarget
Derived: CdpOtherTarget, CdpPageTarget, CdpWorkerTarget
Properties
Section titled “Properties”Opener
Section titled “Opener”public override ITarget Opener { get; }Get the target that opened this target.
Value: ITarget
Top-level targets return null.
TargetId
Section titled “TargetId”public string TargetId { get; }Gets the target identifier.
Value: string — The target identifier.
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.
public override string Url { get; }Gets the URL.
Value: string — The URL.
Methods
Section titled “Methods”AsPageAsync()
Section titled “AsPageAsync()”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.
CheckIfInitialized()
Section titled “CheckIfInitialized()”protected virtual void CheckIfInitialized()Check is the target is not initialized.
CreateCDPSessionAsync()
Section titled “CreateCDPSessionAsync()”public override Task<ICDPSession> CreateCDPSessionAsync()Creates a Chrome Devtools Protocol session attached to the target.
Returns: Task<ICDPSession> — A task that returns a ICDPSession.
Made with love by Dario Kondratiuk