{"id":15045153,"url":"https://github.com/fyrts/chrome-devtools-protocol","last_synced_at":"2025-09-30T19:30:35.392Z","repository":{"id":64956784,"uuid":"578233607","full_name":"fyrts/chrome-devtools-protocol","owner":"fyrts","description":"Chrome Devtools Protocol client for PHP","archived":false,"fork":true,"pushed_at":"2025-01-16T03:03:06.000Z","size":6255,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-19T04:51:41.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jakubkulhan/chrome-devtools-protocol","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fyrts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-14T15:13:35.000Z","updated_at":"2025-01-16T03:03:07.000Z","dependencies_parsed_at":"2023-09-21T16:16:43.573Z","dependency_job_id":"d2a78afb-9150-47a5-89ce-6aaefb9f7108","html_url":"https://github.com/fyrts/chrome-devtools-protocol","commit_stats":{"total_commits":645,"total_committers":10,"mean_commits":64.5,"dds":"0.21550387596899223","last_synced_commit":"9695594de2650d589f69c4e70386310ce3add79d"},"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyrts%2Fchrome-devtools-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyrts%2Fchrome-devtools-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyrts%2Fchrome-devtools-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyrts%2Fchrome-devtools-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fyrts","download_url":"https://codeload.github.com/fyrts/chrome-devtools-protocol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234600986,"owners_count":18858546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:51:31.206Z","updated_at":"2025-09-30T19:30:29.699Z","avatar_url":"https://github.com/fyrts.png","language":"PHP","readme":"# Chrome Devtools Protocol PHP client\n\n[![Build](https://github.com/Fyrts/chrome-devtools-protocol/actions/workflows/phpunit.yml/badge.svg)](https://github.com/Fyrts/chrome-devtools-protocol/actions/workflows/phpunit.yml)\n[![Latest Stable Version](https://poser.pugx.org/fyrts/chrome-devtools-protocol/v/stable?format=flat)](https://packagist.org/packages/fyrts/chrome-devtools-protocol)\n[![License](https://poser.pugx.org/fyrts/chrome-devtools-protocol/license?format=flat)](https://packagist.org/packages/fyrts/chrome-devtools-protocol)\n\n\u003e PHP client for [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/).\n\n## Installation\n\n`composer require fyrts/chrome-devtools-protocol`\n\n## Basic usage\n\n```php\n// context creates deadline for operations\n$ctx = Context::withTimeout(Context::background(), 30 /* seconds */);\n\n// launcher starts chrome process ($instance)\n$launcher = new Launcher();\n$instance = $launcher-\u003elaunch($ctx);\n\ntry {\n\t// work with new tab\n\t$tab = $instance-\u003eopen($ctx);\n\t$tab-\u003eactivate($ctx);\n\n\t$devtools = $tab-\u003edevtools();\n\ttry {\n\t\t$devtools-\u003epage()-\u003eenable($ctx);\n\t\t$devtools-\u003epage()-\u003enavigate($ctx, NavigateRequest::builder()-\u003esetUrl(\"https://www.google.com/\")-\u003ebuild());\n\t\t$devtools-\u003epage()-\u003eawaitLoadEventFired($ctx);\n\n\t\t// ... work with page ...\n\t\t// e.g.\n\t\t// - print to PDF: $devtools-\u003epage()-\u003eprintToPDF($ctx, PrintToPDFRequest::make());\n\t\t// - capture screenshot: $devtools-\u003epage()-\u003ecaptureScreenshot($ctx, CaptureScreenshotRequest::builder()-\u003esetFormat(\"jpg\")-\u003esetQuality(95)-\u003ebuild());\n\n\t} finally {\n\t\t// devtools client needs to be closed\n\t\t$devtools-\u003eclose();\n\t}\n\n} finally {\n\t// process needs to be killed\n\t$instance-\u003eclose();\n}\n```\n\n## Headless Chrome isolated contexts\n\nHeadless 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.\n\nUnlike incognito windows, there can be multiple isolate *browser contexts* at the same time.\n\n```php\n$ctx = Context::withTimeout(Context::background(), 10);\n$launcher = new Launcher();\n$instance = $launcher-\u003elaunch($ctx);\ntry {\n\t$session = $instance-\u003ecreateSession($ctx);\n\ttry {\n\n\t\t// $session implements DevtoolsClientInterface, same as returned from Tab::devtools()\n\n\t} finally {\n\t\t$session-\u003eclose();\n\t}\n} finally {\n\t$instance-\u003eclose();\n}\n```\n\n## License\n\nLicensed under MIT license. See `LICENSE` file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffyrts%2Fchrome-devtools-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffyrts%2Fchrome-devtools-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffyrts%2Fchrome-devtools-protocol/lists"}