diff --git a/src/types.ts b/src/types.ts index 16698bf5..d726b5ea 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,8 @@ export interface Client { target: { id: string } + host?: string + port?: number } export interface DeviceMetrics { diff --git a/src/util.ts b/src/util.ts index 5c92faf7..cd7005b3 100644 --- a/src/util.ts +++ b/src/util.ts @@ -24,7 +24,7 @@ export async function setViewport( fitWindow: false, // as we cannot resize the window, `fitWindow: false` is needed in order for the viewport to be resizable } - const versionResult = await CDP.Version() + const versionResult = await CDP.Version({ port: client.port, host: client.host }); const isHeadless = versionResult['User-Agent'].includes('Headless') if (viewport.height && viewport.width) {