chore: pass down config form CDP connection to BiDi (#12366)

This commit is contained in:
Nikolay Vitkov
2024-04-30 08:23:25 +02:00
committed by GitHub
parent 3103744a67
commit 110351aaf5
2 changed files with 13 additions and 6 deletions

View File

@@ -47,7 +47,12 @@ export async function connectBidiOverCdp(
// Forwards a BiDi event sent by BidiServer to Puppeteer.
pptrTransport.onmessage(JSON.stringify(message));
});
const pptrBiDiConnection = new BidiConnection(cdp.url(), pptrTransport);
const pptrBiDiConnection = new BidiConnection(
cdp.url(),
pptrTransport,
cdp.delay,
cdp.timeout
);
const bidiServer = await BidiMapper.BidiServer.createAndStart(
transportBiDi,
cdpConnectionAdapter,

View File

@@ -26,11 +26,6 @@ import {CdpCDPSession} from './CDPSession.js';
const debugProtocolSend = debug('puppeteer:protocol:SEND ►');
const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀');
/**
* @public
*/
export type {ConnectionTransport, ProtocolMapping};
/**
* @public
*/
@@ -64,6 +59,13 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
return session.connection();
}
/**
* @internal
*/
get delay(): number {
return this.#delay;
}
get timeout(): number {
return this.#timeout;
}