From bc68c3df0b744b3173bc1cce84c422c85db33c13 Mon Sep 17 00:00:00 2001 From: Goran Gajic Date: Mon, 7 Aug 2017 12:10:25 +0200 Subject: [PATCH] pass client host and port to remote interface when chrome is running on some other port than default chromeless was failing silently --- src/types.ts | 2 ++ src/util.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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) {