diegosouzapw/OmniRoute · error · Error

CDP page target is not attached

Error message

CDP page target is not attached

What it means

Error "CDP page target is not attached" thrown in diegosouzapw/OmniRoute.

Source

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

      }
    });
  }

  async attachToPage(targetOrigin: string, signal?: AbortSignal): Promise<void> {
    const { targetInfos } = await this.send("Target.getTargets", {}, undefined, 10_000, signal);
    const page = selectPageTarget(targetInfos || [], targetOrigin);
    const { sessionId } = await this.send(
      "Target.attachToTarget",
      { targetId: page.targetId, flatten: true },
      undefined,
      10_000,
      signal
    );
    this.sessionId = sessionId;
  }

  async getCookies(url: string, signal?: AbortSignal): Promise<any[]> {
    if (!this.sessionId) throw new Error("CDP page target is not attached");
    const result = await this.send(
      "Network.getCookies",
      { urls: [url] },
      this.sessionId,
      10_000,
      signal
    );
    return result.cookies || [];
  }

  async getDeclaredStorage(
    keys: readonly string[],
    signal?: AbortSignal
  ): Promise<Record<string, string>> {
    if (!this.sessionId) throw new Error("CDP page target is not attached");

    const expression = `(() => {
      const keys = ${JSON.stringify([...keys])};

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/vncSession/harvest.ts:193 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/1a7129893ae05c63. Report an issue: GitHub.