Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

pass client host and port to remote interface #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export interface Client {
target: {
id: string
}
host?: string
port?: number
}

export interface DeviceMetrics {
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down