CDP Port Interface (core/ports.ts)

nanobrowser · src/browser-control/core/ports.ts · typescript · Apache-2.0
scraping, infra, tag:browser, tag:protocol, tag:events, tag:interface

Defines interfaces for Chrome DevTools Protocol sessions and events, enabling browser control and event handling.

// Source: https://github.com/nanobrowser/nanobrowser | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// The host interfaces the core works through. Core code never imports Puppeteer or chrome.*; host/ implements these for
// the Chrome extension, and unit tests implement them with recorded payloads.

/** A CDP session: undefined is the tab's root session. */
export type SessionId = string | undefined;

export interface CdpPort {
  readonly tabId: number;
  /** Rejects with LayerError DEBUGGER_DETACHED once the tab is detached, and with CdpTimeoutError on timeout. */
  send<T = unknown>(sessionId: SessionId, method: string, params?: object, timeoutMs?: number): Promise<T>;
  /** S

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key