import CRIConnection from 'chrome-remote-interface-extra/lib/connection/CRIConnection.js'
CRIConnection
Extends:
An exact replica of puppeteer's Connection class that simply re-uses the prior art that is the one and only chrome-remote-interface by cyrus-and
Static Method Summary
Static Public Methods | ||
public static |
async connect(options: CRIOptions): Promise<CRIConnection> |
|
public static |
fromSession(session: CDPSession | Chrome | Object): CRIConnection | Chrome | Object |
Constructor Summary
Public Constructor | ||
public |
constructor(options: CRIOptions, notifier: EventEmitter) |
Member Summary
Public Members | ||
public get |
Get the actual event that is emitted when the connection has closed |
|
public |
webSocketUrl: * |
Private Members | ||
private |
|
|
private |
_crieCallbacks: function(value: *): void, reject |
|
private |
|
|
private |
_ws: * |
Method Summary
Public Methods | ||
public |
async createSession(targetInfo: Object): Promise<CDPSession> |
|
public |
dispose() |
|
public |
|
|
public |
session(sessionId: string): CDPSession |
|
public |
|
Protected Methods | ||
protected |
_interopSend(method: string, params: Object, callback: *): * Utility function for maintaining the original CRI API |
Private Methods | ||
private |
_connectToWebSocket(): Promise<*> This override really on exists to turn off perMessageDeflate when creating the web socket |
|
private |
_handleMessage(object: Object): * A very simple override of the original _handleMessage function that adds the handling both the puppeteer API and the original CRI API (minus direct sends) |
|
private |
_onClose() |
|
private |
In order to have CDP sessions and allow them to operate as they do in Puppeteer we need to provide them a special method for them to send their messages and this is it :) |
|
private |
_start(): * |
Static Public Methods
public static async connect(options: CRIOptions): Promise<CRIConnection> source
Params:
Name | Type | Attribute | Description |
options | CRIOptions |
|
public static fromSession(session: CDPSession | Chrome | Object): CRIConnection | Chrome | Object source
Params:
Name | Type | Attribute | Description |
session | CDPSession | Chrome | Object |
Public Constructors
public constructor(options: CRIOptions, notifier: EventEmitter) source
Params:
Name | Type | Attribute | Description |
options | CRIOptions | ||
notifier | EventEmitter |
Public Members
public get $$disconnectEvent: string: * source
Get the actual event that is emitted when the connection has closed
public webSocketUrl: * source
Private Members
private _sessions: Map<string, CDPSession> source
private _ws: * source
Public Methods
public async createSession(targetInfo: Object): Promise<CDPSession> source
Params:
Name | Type | Attribute | Description |
targetInfo | Object |
public dispose() source
public session(sessionId: string): CDPSession source
Params:
Name | Type | Attribute | Description |
sessionId | string |
Protected Methods
protected _interopSend(method: string, params: Object, callback: *): * source
Utility function for maintaining the original CRI API
Return:
* |
Private Methods
private _connectToWebSocket(): Promise<*> source
This override really on exists to turn off perMessageDeflate when creating the web socket
private _handleMessage(object: Object): * source
A very simple override of the original _handleMessage function that adds the handling both the puppeteer API and the original CRI API (minus direct sends)
Params:
Name | Type | Attribute | Description |
object | Object |
Return:
* |