/** * CdpSessionUrlTracker — sniffs the Chrome→Client leg of the CDP WebSocket * proxy and maintains a `sessionId -> currentUrl` map keyed the same way * navigation-watcher.ts keys its session state. The map feeds the Client→ * Chrome unmask gate (cdp-unmask.ts) so per-frame unmasking is scoped to * the target tab's actual current URL. * * Three CDP events feed the tracker: * - `Target.attachedToTarget` → seed via `params.sessionId` + `params.targetInfo.url` * - `Target.targetInfoChanged` → keyed by `params.targetInfo.targetId`; updates * every session pointing at that target * - `Page.frameNavigated` (root) → `sessionId` lives at the wire-frame top level; * only the root frame (no parentId) updates the session url * * `Target.detachedFromTarget` clears the entry. Everything else is a no-op. * * Hostname resolution is done lazily via `getHostname(sessionId)`. Empty, * un-parseable, or `about:blank`-style URLs fail closed (return null). */ export interface CdpSessionUrlTracker { observeChromeToClient(frame: unknown): void; getHostname(sessionId: string | undefined): string | null; getUrl(sessionId: string | undefined): string | null; size(): number; clear(): void; } export declare function createCdpSessionUrlTracker(): CdpSessionUrlTracker;