fix: support authenticated remote CDP URLs (#895) (thanks @mukhtharcm)

This commit is contained in:
Peter Steinberger
2026-01-16 08:31:51 +00:00
parent 8e80823b03
commit bf15c87d2b
15 changed files with 179 additions and 100 deletions

View File

@@ -129,6 +129,11 @@ vi.mock("./cdp.js", () => ({
normalizeCdpWsUrl: vi.fn((wsUrl: string) => wsUrl),
snapshotAria: cdpMocks.snapshotAria,
getHeadersWithAuth: vi.fn(() => ({})),
appendCdpPath: vi.fn((cdpUrl: string, path: string) => {
const base = cdpUrl.replace(/\/$/, "");
const suffix = path.startsWith("/") ? path : `/${path}`;
return `${base}${suffix}`;
}),
}));
vi.mock("./pw-ai.js", () => pwMocks);