All Projects → jakubkulhan → Chrome Devtools Protocol

jakubkulhan / Chrome Devtools Protocol

Licence: mit
Chrome Devtools Protocol client for PHP

Projects that are alternatives of or similar to Chrome Devtools Protocol

Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (+748.21%)
Mutual labels:  automation, chrome, headless, headless-chrome
Pychrome
A Python Package for the Google Chrome Dev Protocol [threading base]
Stars: ✭ 469 (+318.75%)
Mutual labels:  chrome, headless, headless-chrome, chrome-devtools
Ferrum
Headless Chrome Ruby API
Stars: ✭ 1,009 (+800.89%)
Mutual labels:  automation, chrome, headless, headless-chrome
Crawlergo
A powerful dynamic crawler for web vulnerability scanners
Stars: ✭ 1,088 (+871.43%)
Mutual labels:  headless, headless-chrome, chrome-devtools
Gowitness
🔍 gowitness - a golang, web screenshot utility using Chrome Headless
Stars: ✭ 996 (+789.29%)
Mutual labels:  chrome, headless, headless-chrome
Taiko
A node.js library for testing modern web applications
Stars: ✭ 2,964 (+2546.43%)
Mutual labels:  automation, headless, headless-chrome
Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (+68.75%)
Mutual labels:  automation, chrome, headless-chrome
Wrp
Web Rendering Proxy: Use vintage, historical, legacy browsers on modern web
Stars: ✭ 503 (+349.11%)
Mutual labels:  chrome, headless-chrome, chrome-devtools
Mocha Chrome
☕️ Run Mocha tests using headless Google Chrome
Stars: ✭ 66 (-41.07%)
Mutual labels:  chrome, headless, headless-chrome
Chromedp
A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.
Stars: ✭ 7,057 (+6200.89%)
Mutual labels:  chrome, headless, chrome-devtools
Puppeteer Api Zh cn
📖 Puppeteer中文文档(官方指定的中文文档)
Stars: ✭ 697 (+522.32%)
Mutual labels:  automation, chrome, headless
Go Chrome
A golang library for interacting with the Chrome DevTools Protocol. https://chromedevtools.github.io/devtools-protocol/
Stars: ✭ 96 (-14.29%)
Mutual labels:  chrome, headless, chrome-devtools
Cdp4j
cdp4j - Chrome DevTools Protocol for Java
Stars: ✭ 232 (+107.14%)
Mutual labels:  automation, chrome, chrome-devtools
Playwright Go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Stars: ✭ 272 (+142.86%)
Mutual labels:  automation, headless, headless-chrome
Puppeteer Extra
💯 Teach puppeteer new tricks through plugins.
Stars: ✭ 3,397 (+2933.04%)
Mutual labels:  automation, chrome, headless-chrome
Rod
A Devtools driver for web automation and scraping
Stars: ✭ 1,392 (+1142.86%)
Mutual labels:  automation, headless, chrome-devtools
Phpchrometopdf
A slim PHP wrapper around google-chrome to convert url to pdf or to take screenshots , easy to use and clean OOP interface
Stars: ✭ 127 (+13.39%)
Mutual labels:  chrome, headless, headless-chrome
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+11733.93%)
Mutual labels:  chrome, headless, headless-chrome
Html Pdf Chrome
HTML to PDF converter via Chrome/Chromium
Stars: ✭ 629 (+461.61%)
Mutual labels:  chrome, headless, headless-chrome
Cuprite
Headless Chrome/Chromium driver for Capybara
Stars: ✭ 743 (+563.39%)
Mutual labels:  chrome, headless, headless-chrome

Chrome Devtools Protocol PHP client

Build Latest Stable Version License

PHP client for Chrome Devtools Protocol.

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 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();
}

License

Licensed under MIT license. See LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].