⚡
Zero Dependencies
Built entirely on Zig's standard library. No external dependencies required.
Native CDP client with zero external dependencies
const std = @import("std");
const cdp = @import("cdp");
pub fn main(init: std.process.Init) !void {
const allocator = init.gpa;
// Launch browser
var browser = try cdp.Browser.launch(.{
.headless = .new,
.allocator = allocator,
.io = init.io,
});
defer browser.close();
// Create new page and navigate
var session = try browser.newPage();
var page = cdp.Page.init(session);
try page.enable();
_ = try page.navigate(allocator, "https://example.com");
// Capture screenshot
const screenshot = try page.captureScreenshot(allocator, .{ .format = .png });
defer allocator.free(screenshot);
}| Domain | Description |
|---|---|
| Page | Navigation, screenshots, PDF generation |
| DOM | Document querying and manipulation |
| Runtime | JavaScript execution |
| Network | Request/response tracking |
| Input | Mouse and keyboard events |
| Emulation | Device and viewport emulation |
| Fetch | Network request interception |
| Storage | Cookies and local storage |
| Target | Tab and target management |
| Performance | Performance metrics |
| Browser | Browser-level operations |