diff --git a/src/common/Connection.ts b/src/common/Connection.ts index 0b5c46f5bec0f..8cfc061bcc34b 100644 --- a/src/common/Connection.ts +++ b/src/common/Connection.ts @@ -66,7 +66,7 @@ export class Connection extends EventEmitter { this.#delay = delay; this.#transport = transport; - this.#transport.onmessage = this.#onMessage.bind(this); + this.#transport.onmessage = this.onMessage.bind(this); this.#transport.onclose = this.#onClose.bind(this); } @@ -81,6 +81,13 @@ export class Connection extends EventEmitter { return this.#closed; } + /** + * @internal + */ + get _sessions(): Map { + return this.#sessions; + } + /** * @param sessionId - The session id * @returns The current CDP session if it exists @@ -126,7 +133,10 @@ export class Connection extends EventEmitter { return id; } - async #onMessage(message: string): Promise { + /** + * @internal + */ + protected async onMessage(message: string): Promise { if (this.#delay) { await new Promise(f => { return setTimeout(f, this.#delay);