PHPackages                             dzentota/chrome-dev-tools - 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. dzentota/chrome-dev-tools

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

dzentota/chrome-dev-tools
=========================

This is a PHP lib that allows one to interact with Google Chrome using Chrome DevTools Protocol within a PHP script. Highly inspired by marty90/PyChromeDevTools

126.4k↓33.3%7[3 issues](https://github.com/dzentota/chrome-dev-tools/issues)PHP

Since Oct 11Pushed 8y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

chrome-dev-tools
================

[](#chrome-dev-tools)

1. Description
==============

[](#1-description)

This is a PHP lib that allows one to interact with Google Chrome using [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) within a PHP script. To use this tool, you must run an instance of Google Chrome with the `remote-debugging` option, like in the following example.

```
google-chrome --remote-debugging-port=9222

```

You may want to enable further Chrome benchmarking capabilities using the `--enable-benchmarking` and `--enable-net-benchmarking` options. You can run Chrome in headless mode using the option `--headless`.

2. Prerequisites
================

[](#2-prerequisites)

An updated Google-Chrome version

3. Operation
============

[](#3-operation)

3.1 Init
--------

[](#31-init)

In your php script, as first, you must create a Chrome object, like in the following:

```
$chrome = new ChromeDevTools\Chrome();
```

You can specify the host and the port of Chrome manually writing:

```
$chrome = new ChromeDevTools\Chrome($host="1.1.1.1", $port=1234);
```

By default it uses `localhost:9222`.

3.1 Run commands
----------------

[](#31-run-commands)

To send a command to Chrome, just invoke the corresponding method on the Chrome object, and pass the desired parameters. For example, to visit a page write:

```
$chrome->Page->navigate(['url' => 'http://example.com/']);
```

The return value of the command is passed as return value of the function, already interpreted as JSON.

3.1 Receive Events
------------------

[](#31-receive-events)

Chrome sends back messages for particular events in the browser. You can get them in two ways; they are returned already interpreted as JSON. All unread events are erased before any new command is run.

a) You can pop one message from the queue of received ones writing:

```
$message = $chrome->waitMessage();
```

The method accepts an optional parameter `timeout` which is the value in seconds after which it gives up and returns `null`. Default is 1.

b) You can wait for a specific event writing:

```
$result = $chrome->waitEvent('event_name');
$matchingEvent = $result['matching_message'];
$messages = $result['messages'];
```

It waits until an event with the name `event_name` arrives, or a timeout elapses. `$matchingEvent` contains the first found event that has `event_name`, while `$messages` contains all messages arrived before. Timeout value can be configured as in the previous method.

4. Examples
===========

[](#4-examples)

@See `examples` folder
----------------------

[](#see-examples-folder)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/834595?v=4)[Alexandr Tatulchenkov](/maintainers/dzentota)[@dzentota](https://github.com/dzentota)

---

Top Contributors

[![dzentota](https://avatars.githubusercontent.com/u/834595?v=4)](https://github.com/dzentota "dzentota (6 commits)")

### Embed Badge

![Health badge](/badges/dzentota-chrome-dev-tools/health.svg)

```
[![Health](https://phpackages.com/badges/dzentota-chrome-dev-tools/health.svg)](https://phpackages.com/packages/dzentota-chrome-dev-tools)
```

###  Alternatives

[cdamian/plus-pull

Script to merge Github pull requests, which have enough +1 votes

1413.9k](/packages/cdamian-plus-pull)

PHPackages © 2026

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