{"id":28508998,"url":"https://github.com/tryggvigy/chrome-devtools-protocol-screenshot","last_synced_at":"2025-07-02T23:32:07.281Z","repository":{"id":57198408,"uuid":"103864526","full_name":"tryggvigy/chrome-devtools-protocol-screenshot","owner":"tryggvigy","description":"CLI tool to captures screenshots using chrome devtools protocol","archived":false,"fork":false,"pushed_at":"2017-09-17T22:28:26.000Z","size":10,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-08T22:07:39.209Z","etag":null,"topics":["apache2","chrome-devtools-protocol","cli-utilities","screenshot"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tryggvigy.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}},"created_at":"2017-09-17T21:51:11.000Z","updated_at":"2025-02-10T23:19:11.000Z","dependencies_parsed_at":"2022-09-16T13:12:31.289Z","dependency_job_id":null,"html_url":"https://github.com/tryggvigy/chrome-devtools-protocol-screenshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tryggvigy/chrome-devtools-protocol-screenshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fchrome-devtools-protocol-screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fchrome-devtools-protocol-screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fchrome-devtools-protocol-screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fchrome-devtools-protocol-screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tryggvigy","download_url":"https://codeload.github.com/tryggvigy/chrome-devtools-protocol-screenshot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fchrome-devtools-protocol-screenshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263232752,"owners_count":23434728,"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":["apache2","chrome-devtools-protocol","cli-utilities","screenshot"],"created_at":"2025-06-08T22:07:07.203Z","updated_at":"2025-07-02T23:32:07.244Z","avatar_url":"https://github.com/tryggvigy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This tool reads instructions from stdin or args and captures screenshots\nusing the chrome devtools protocol from a running blink-based\nbrowser instance at various given breakpoints.\n\n```npm install -g chrome-devtools-protocol-screenshot```\n\nand then start on your chromium browsers remote debug port.\n\n```chrome-devtools-protocol-screenshot.js -p 9222```\n\n#### Stdin\nIf you have a `inst.json` like the following (you can use any uri, for example http://example.com)\n```json\n{\n  \"uris\": {\n    \"spotify:album:6LBiuhK7PZKjVXyMfPxPoh\": {\n      \"breakPoints\": [1200, 800, 400]\n    },\n    \"spotify:artist:7xUZ4069zcyBM4Bn10NQ1c\": {\n      \"breakPoints\": [1200, 600]\n    }\n  }\n}\n```\n\nthen\n\n```\ncat inst.json | chrome-devtools-protocol-screenshot --outputDir ./captures --remoteDebuggingPort 9222\n```\nwill output screenshots of these uris at these widths to the output directory.\n\n#### args\n```\nchrome-devtools-protocol-screenshot --outputDir ./captures --remoteDebuggingPort 9222 --breakPoints 1200,800\n```\nWill create screenshots at 1200 width and 800 width of the current page \nin the chromium app and output them to ./captures.\n\n## Comparison\n\nYou can use whatever image comparison tool you like.\nI like to use ImageMagik.\n\n```\nconvert '(' img1.png ')' \\\n        '(' img2.png ')' \\\n        '(' -clone 0-1 -compose darken -composite ')' \\\n        -channel RGB -combine diff.png\n```\nGenerates:\n![](https://i.imgur.com/RqAOcdW.png)\n\n```\ncompare foo_prod.png foo_dev.png diff.png\n```\nGenerates:\n![](https://i.imgur.com/eeyo050.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryggvigy%2Fchrome-devtools-protocol-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftryggvigy%2Fchrome-devtools-protocol-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryggvigy%2Fchrome-devtools-protocol-screenshot/lists"}