aboutsummaryrefslogtreecommitdiff
path: root/src/cdp/discovery.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cdp/discovery.ts')
-rw-r--r--src/cdp/discovery.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cdp/discovery.ts b/src/cdp/discovery.ts
index 53d4ad2..84da5f9 100644
--- a/src/cdp/discovery.ts
+++ b/src/cdp/discovery.ts
@@ -7,6 +7,7 @@ import { userDataDirCandidates } from "../profile/paths";
import { type CdpError, cdpError } from "./errors";
import { asString, errnoCode, isRecord } from "../util/guards";
import { describeCdpTarget, resolveCdpTarget } from "./endpoint";
+import { readTarget } from "./target-store";
const PORT_PROBE_DEADLINE_MS = 30_000;
const PORT_PROBE_INTERVAL_MS = 1_000;
@@ -127,7 +128,7 @@ export const discoverEndpoint = async (): Promise<Result<CdpEndpoint, CdpError>>
// No userDataDir is returned: the profile registry lives on the remote host,
// so profile enumeration degrades to the pre-profile behaviour rather than
// reading the wrong machine's Local State.
- const target = resolveCdpTarget();
+ const target = resolveCdpTarget(process.env, await readTarget());
if (target.kind === "invalid") {
return err(cdpError("discovery_failed", describeCdpTarget(target)));
}