feat(browser): add support for authenticated remote CDP profiles

This commit is contained in:
Muhammed Mukhthar CM
2026-01-14 07:43:29 +00:00
committed by Peter Steinberger
parent d0cb4e092f
commit 6e0daf0936
4 changed files with 95 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ import WebSocket from "ws";
import { ensurePortAvailable } from "../infra/ports.js";
import { createSubsystemLogger } from "../logging.js";
import { CONFIG_DIR } from "../utils.js";
import { normalizeCdpWsUrl } from "./cdp.js";
import { getHeadersWithAuth, normalizeCdpWsUrl } from "./cdp.js";
import {
type BrowserExecutable,
resolveBrowserExecutableForPlatform,
@@ -74,6 +74,7 @@ async function fetchChromeVersion(cdpUrl: string, timeoutMs = 500): Promise<Chro
const base = cdpUrl.replace(/\/$/, "");
const res = await fetch(`${base}/json/version`, {
signal: ctrl.signal,
headers: getHeadersWithAuth(`${base}/json/version`),
});
if (!res.ok) return null;
const data = (await res.json()) as ChromeVersion;