PHPackages                             jakubkulhan/chrome-devtools-protocol - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jakubkulhan/chrome-devtools-protocol

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jakubkulhan/chrome-devtools-protocol
====================================

Chrome Devtools Protocol client for PHP

v1.0.4(5y ago)183967.6k↓26.7%50[7 PRs](https://github.com/jakubkulhan/chrome-devtools-protocol/pulls)3MITPHPPHP ~7.1

Since Nov 21Pushed 1mo ago14 watchersCompare

[ Source](https://github.com/jakubkulhan/chrome-devtools-protocol)[ Packagist](https://packagist.org/packages/jakubkulhan/chrome-devtools-protocol)[ RSS](/packages/jakubkulhan-chrome-devtools-protocol/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (18)Used By (3)

Chrome Devtools Protocol PHP client
===================================

[](#chrome-devtools-protocol-php-client)

[![Build](https://camo.githubusercontent.com/81e84aeecbc494347df0440511c4e621d84da5fcf141e4944ba6fc62ab0b7b67/68747470733a2f2f636972636c6563692e636f6d2f67682f6a616b75626b756c68616e2f6368726f6d652d646576746f6f6c732d70726f746f636f6c2e7376673f7374796c653d737667)](https://circleci.com/gh/jakubkulhan/chrome-devtools-protocol)[![Latest Stable Version](https://camo.githubusercontent.com/838679853b421a6437694253bb8fd87ae45604091583e90b6057398de45b1f83/68747470733a2f2f706f7365722e707567782e6f72672f6a616b75626b756c68616e2f6368726f6d652d646576746f6f6c732d70726f746f636f6c2f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/jakubkulhan/chrome-devtools-protocol)[![License](https://camo.githubusercontent.com/dda334aaff60c521f07400b9a616478f1718ebe9c68eb62451925469b2f336f9/68747470733a2f2f706f7365722e707567782e6f72672f6a616b75626b756c68616e2f6368726f6d652d646576746f6f6c732d70726f746f636f6c2f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/jakubkulhan/chrome-devtools-protocol)

> PHP client for [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/).

Basic usage
-----------

[](#basic-usage)

```
// context creates deadline for operations
$ctx = Context::withTimeout(Context::background(), 30 /* seconds */);

// launcher starts chrome process ($instance)
$launcher = new Launcher();
$instance = $launcher->launch($ctx);

try {
	// work with new tab
	$tab = $instance->open($ctx);
	$tab->activate($ctx);

	$devtools = $tab->devtools();
	try {
		$devtools->page()->enable($ctx);
		$devtools->page()->navigate($ctx, NavigateRequest::builder()->setUrl("https://www.google.com/")->build());
		$devtools->page()->awaitLoadEventFired($ctx);

		// ... work with page ...
		// e.g.
		// - print to PDF: $devtools->page()->printToPDF($ctx, PrintToPDFRequest::make());
		// - capture screenshot: $devtools->page()->captureScreenshot($ctx, CaptureScreenshotRequest::builder()->setFormat("jpg")->setQuality(95)->build());

	} finally {
		// devtools client needs to be closed
		$devtools->close();
	}

} finally {
	// process needs to be killed
	$instance->close();
}
```

Headless Chrome isolated contexts
---------------------------------

[](#headless-chrome-isolated-contexts)

Headless Chrome supports feature called *browser contexts* - they're like incognito windows - cookies, local storage etc. are not shared. After *browser context* is destroyed, user data created in given context, are destroyed.

Unlike incognito windows, there can be multiple isolate *browser contexts* at the same time.

```
$ctx = Context::withTimeout(Context::background(), 10);
$launcher = new Launcher();
$instance = $launcher->launch($ctx);
try {
	$session = $instance->createSession($ctx);
	try {

		// $session implements DevtoolsClientInterface, same as returned from Tab::devtools()

	} finally {
		$session->close();
	}
} finally {
	$instance->close();
}
```

Using an already running Chrome browser
---------------------------------------

[](#using-an-already-running-chrome-browser)

```
use ChromeDevtoolsProtocol\Instance\Instance;

$instance = new Instance(/* host: */ "localhost", /* port: */ 9222);

$ctx = Context::withTimeout(Context::background(), 30 /* seconds */);

$tab = $instance->open($ctx);
$tab->activate($ctx);

$devtools = $tab->devtools();

// ...work with devtools

// no need to call ->close() as no new process is started
```

License
-------

[](#license)

Licensed under MIT license. See `LICENSE` file.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance59

Moderate activity, may be stable

Popularity55

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~205 days

Total

17

Last Release

2149d ago

Major Versions

v0.4.0 → v1.0.02018-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/336ce4f2acf4ba19e86fe9edd33831c36d48e61858878d86af2b59728bf0a1a4?d=identicon)[jakubkulhan](/maintainers/jakubkulhan)

---

Top Contributors

[![jakubkulhan](https://avatars.githubusercontent.com/u/95001?v=4)](https://github.com/jakubkulhan "jakubkulhan (74 commits)")[![hongaar](https://avatars.githubusercontent.com/u/205834?v=4)](https://github.com/hongaar "hongaar (7 commits)")[![JanBukva](https://avatars.githubusercontent.com/u/7108035?v=4)](https://github.com/JanBukva "JanBukva (3 commits)")[![mikenz](https://avatars.githubusercontent.com/u/6816?v=4)](https://github.com/mikenz "mikenz (1 commits)")[![mstyles](https://avatars.githubusercontent.com/u/1187931?v=4)](https://github.com/mstyles "mstyles (1 commits)")[![voldemortensen](https://avatars.githubusercontent.com/u/7786383?v=4)](https://github.com/voldemortensen "voldemortensen (1 commits)")

---

Tags

automationchromechrome-devtoolschrome-devtools-protocolheadlessheadless-chromewebwebautomationchromeheadless-chromechrome-devtoolschrome-devtools-protocol

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jakubkulhan-chrome-devtools-protocol/health.svg)

```
[![Health](https://phpackages.com/badges/jakubkulhan-chrome-devtools-protocol/health.svg)](https://phpackages.com/packages/jakubkulhan-chrome-devtools-protocol)
```

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[nigelcunningham/puphpeteer

A Puppeteer bridge for PHP, supporting the entire API.

2221.7k](/packages/nigelcunningham-puphpeteer)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
