Home Reference Source
public class | source

CDPSession

Extends:

eventemitter3~EventEmitter → CDPSession

Constructor Summary

Public Constructor
public

constructor(connection: CRIConnection | Chrome | Object, targetType: string, sessionId: string)

Member Summary

Public Members
public get

Get the actual event that is emitted when the connection has closed

Private Members
private
private
private
private

Method Summary

Public Methods
public
public

async detach(): Promise<void>

Detaches the cdpSession from the target.

public

send(method: string, params: Object): Promise<Object>

public
Private Methods
private
private

_onMessage(object: {id: ?number, method: string, params: Object, error: {message: string, data: *}, result: *})

Public Constructors

public constructor(connection: CRIConnection | Chrome | Object, targetType: string, sessionId: string) source

Params:

NameTypeAttributeDescription
connection CRIConnection | Chrome | Object
targetType string
sessionId string

Public Members

public get $$disconnectEvent: string: * source

Get the actual event that is emitted when the connection has closed

Return:

string

Private Members

private _callbacks: Map<number, Object> source

private _connection: CRIConnection | Chrome | Object source

private _sessionId: string source

private _targetType: string source

Public Methods

public createSession(targetInfo: Object): Promise<CDPSession> source

Params:

NameTypeAttributeDescription
targetInfo Object

Return:

Promise<CDPSession>

public async detach(): Promise<void> source

Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages

Return:

Promise<void>

public send(method: string, params: Object): Promise<Object> source

Params:

NameTypeAttributeDescription
method string

protocol method name

params Object
  • optional
  • default: {}
  • nullable: false

Optional method parameters

Return:

Promise<Object>

public toString(): string source

Return:

string

Private Methods

private _onClosed() source

private _onMessage(object: {id: ?number, method: string, params: Object, error: {message: string, data: *}, result: *}) source

Params:

NameTypeAttributeDescription
object {id: ?number, method: string, params: Object, error: {message: string, data: *}, result: *}