universal_browser_cdp 0.1.0
universal_browser_cdp: ^0.1.0 copied to clipboard
Pure-Dart Chrome DevTools Protocol (CDP) client: discovery, WebSocket JSON-RPC, accessibility snapshots, input synthesis, screenshots, and a fake CDP server for tests. No Flutter, no Node.
universal_browser_cdp #
Pure-Dart Chrome DevTools Protocol (CDP) client: discovery, WebSocket JSON-RPC, accessibility snapshots, intent-level input synthesis, and screenshots. No Flutter, no Node, no Java.
Part of the universal_automation_* family
(ADR 0037).
What it does #
CdpDiscovery—/json/versionreadiness probe (oka's borrowed-lease identity check) and/json/listtarget enumeration.CdpConnection— correlated JSON-RPC over WebSocket with a broadcast event stream.CdpPage— navigation,Runtime.evaluate, accessibility-tree snapshots mapped to the family'sAxNodemodel, screenshots, and trusted input (Input.dispatchMouseEvent/insertTextat resolved element rects).CdpDriver/CdpBrowserSession— the observe/act/verifyAutomationDriverover a page.package:universal_browser_cdp/testing.dart— a scriptableFakeCdpServerso consumers can test their pipelines without Chrome.
Usage #
// Production: take the endpoint oka published
// (session-<name>-handle / browser-debug-uri) — never spawn here.
final session = await CdpBrowserSession.attach(
Uri.parse('http://127.0.0.1:9222'),
);
final driver = session.driver;
final snapshot = await driver.snapshot();
await driver.perform(ClickAction(css: '#submit'));
await driver.screenshot();
await session.close();
Non-claims #
- Chromium-only (CDP). Firefox/WebKit need WebDriver — see
universal_browser_webdriver. - No lifecycle ownership: this package never launches or kills browsers.
- Web (dart2js/ddc) is not a target; the client requires
dart:io.