About this project
This package provides a PHP client for the Chrome DevTools Protocol, the interface used to control Chrome/Chromium browsers programmatically. It is distributed via Composer under the package name jakubkulhan/chrome-devtools-protocol and is licensed under MIT.
Core capabilities evidenced by the README:
- Launching a Chrome process through a Launcher class, with a Context object used to set operation deadlines (for example a 30-second timeout).
- Opening and activating tabs on a launched instance, then obtaining a DevTools client for that tab.
- Driving page operations such as enabling the Page domain, navigating to a URL, and awaiting the load event.
- Producing output from pages, including printing to PDF and capturing screenshots with configurable format and quality.
- Managing lifecycle explicitly: the DevTools client must be closed, and the browser process must be killed when finished.
Isolated browser contexts:
The library supports headless Chrome browser contexts, described as similar to incognito windows where cookies and local storage are not shared. Unlike incognito windows, multiple isolated browser contexts can exist simultaneously. A session created this way implements the same DevtoolsClientInterface returned by a tab's devtools() method.
Connecting to an existing browser:
An Instance can be constructed directly from a host and port (for example localhost:9222), allowing the client to attach to an already running Chrome browser. In this mode no new process is started, so closing the instance is not required.
The README shows usage examples in PHP covering context creation, launching, tab handling, DevTools calls, and cleanup. Build status, stable version and license badges link to CircleCI, Packagist and the license file respectively.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.