Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

chrome-devtools-protocol

> 开发工具
Open source

Chrome Devtools Protocol client for PHP

185 stars0 likes1 views
WebsiteGitHub

About

Chrome Devtools Protocol client for PHP

Chrome Devtools Protocol PHP client

PHP client for Chrome Devtools Protocol.

Basic usage

…

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.

php
$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

php
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

Licensed under MIT license. See LICENSE file.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPautomationchromechrome-devtoolschrome-devtools-protocol

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具