diegosouzapw/OmniRoute · error · Error

No browser page is open for

Error message

No browser page is open for ${targetOrigin}

What it means

Thrown by selectPageTarget when the CDP target list contains page-type targets but none whose URL origin equals the requested provider origin (safeOrigin returns null for unparseable URLs, which also never match). Means the user has not actually completed/kept open the provider login page in the VNC browser — the harvest was attempted against the wrong or a still-navigating tab.

Solutions

  1. Have the user open/navigate to the provider's login page in the VNC viewer before harvesting
  2. Wait for redirects to settle (SSO hops can momentarily land on other origins) and re-harvest
  3. Check /json/targets on the CDP port to see which page URLs the browser actually has open
  4. If the provider origin config changed, update the VNC provider entry's expected origin
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/vncSession/harvest.ts:394 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/f2db92f482437e90. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/harvest.ts:394

  return { providerSpecificData, apiKey: null };
}

export function rewriteDebuggerUrl(debuggerUrl: string, cdpPort: number): string {
  const url = new URL(debuggerUrl);
  url.protocol = "ws:";
  url.hostname = "127.0.0.1";
  url.port = String(cdpPort);
  return url.toString();
}

export function selectPageTarget(
  targetInfos: CdpTargetInfo[],
  targetOrigin: string
): CdpTargetInfo {
  const pages = targetInfos.filter((target) => target.type === "page");
  const matching = pages.find((target) => safeOrigin(target.url) === targetOrigin);
  if (matching) return matching;
  throw new Error(`No browser page is open for ${targetOrigin}`);
}

function safeOrigin(value: string | undefined): string | null {
  if (!value) return null;
  try {
    return new URL(value).origin;
  } catch {
    return null;
  }
}

async function fetchJson(url: string, signal: AbortSignal): Promise<any> {
  const response = await fetch(url, { signal });
  if (!response.ok) throw new Error(`CDP endpoint returned HTTP ${response.status}`);
  return response.json();
}

function domainMatches(cookieDomain: string, origin: string): boolean {

View on GitHub (pinned to a179ffed5b)