chrome-remote-interface is a Node.js library that lets you control a browser programmatically from JavaScript code. It works by connecting to a debugging port that Chrome, Firefox, Opera, Edge, and a few other browsers can expose when started with a special flag. Once connected, your code can instruct the browser to load pages, monitor network requests, run JavaScript expressions, take screenshots, and more. The way it works is straightforward: you start the browser with a remote-debugging option, then your Node.js script connects to it using this library. From there you get access to the browser's internal protocol, which is organized into named domains like Network, Page, and Runtime. Each domain has commands you can call and events you can listen to. For example, you can tell the Page domain to navigate to a URL, then wait for a load event to fire before doing anything else. This library was built to wrap that protocol in a cleaner JavaScript interface. Without it, you would need to speak directly to the browser over a WebSocket and handle the raw message format yourself. The library does that low-level work and exposes the commands and events as regular async JavaScript functions. It is not limited to Chrome. The README lists tested compatibility with Opera, Node.js itself in inspect mode, mobile Safari via a proxy tool, Edge, and Firefox Nightly. Support varies: Chrome has the fullest coverage, while mobile Safari only supports a subset of the protocol. The package also ships a command-line client for interactive use. You can open a REPL that connects to a running browser, execute commands by typing them, and watch events stream in. This is useful for exploration or one-off tasks without writing a full script. The full README is longer than what was shown.
← cyrus-and on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.