{"id":16131879,"url":"https://github.com/andrewvy/chrome-remote-interface","last_synced_at":"2025-04-06T19:13:06.342Z","repository":{"id":24094553,"uuid":"100463252","full_name":"andrewvy/chrome-remote-interface","owner":"andrewvy","description":"Elixir Client for the Chrome Debugger Protocol","archived":false,"fork":false,"pushed_at":"2024-02-19T17:10:42.000Z","size":290,"stargazers_count":62,"open_issues_count":13,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T05:57:06.910Z","etag":null,"topics":["chrome-debugging-protocol","elixir","headless-chrome"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/chrome_remote_interface","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewvy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-16T07:53:48.000Z","updated_at":"2024-06-19T01:36:30.784Z","dependencies_parsed_at":"2024-06-19T01:36:27.789Z","dependency_job_id":"70584920-1d4a-498d-829a-e314ebb2082c","html_url":"https://github.com/andrewvy/chrome-remote-interface","commit_stats":{"total_commits":46,"total_committers":5,"mean_commits":9.2,"dds":"0.17391304347826086","last_synced_commit":"3de6b9f5856a08aa72ce692f7cf32eb24ca36083"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewvy%2Fchrome-remote-interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewvy%2Fchrome-remote-interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewvy%2Fchrome-remote-interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewvy%2Fchrome-remote-interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewvy","download_url":"https://codeload.github.com/andrewvy/chrome-remote-interface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535519,"owners_count":20954576,"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":["chrome-debugging-protocol","elixir","headless-chrome"],"created_at":"2024-10-09T22:27:57.009Z","updated_at":"2025-04-06T19:13:06.317Z","avatar_url":"https://github.com/andrewvy.png","language":"Elixir","readme":"# Chrome Remote Interface\n\n[![CircleCI](https://img.shields.io/circleci/project/github/andrewvy/chrome-remote-interface.svg)](https://circleci.com/gh/andrewvy/chrome-remote-interface)\n\nThis library provides an Elixir Client to the [Chrome Debugging Protocol](https://chromedevtools.github.io/devtools-protocol/) with\na small layer of abstraction for handling and subscribing to domain events.\n\nNote: This is a super minimal client wrapper around the Chrome Debugging Protocol.\n\n## Installation\n\nAdd `:chrome_remote_interface` to your `mix.exs` file!\n\n```elixir\ndef deps do\n  [\n    {:chrome_remote_interface, \"~\u003e 0.4.1\"}\n  ]\nend\n```\n\n### Chrome DevTools Protocol Selection\n\nChrome Remote Interface generated its API at compile time from the protocol\ndefinition released by the Chrome DevTools Team.\nFor more info see: [https://chromedevtools.github.io/devtools-protocol/](https://chromedevtools.github.io/devtools-protocol/)\n\nThis can be overridden by setting `CRI_PROTOCOL_VERSION` environment variable\nto:\n* 1-2\n* 1-3 * default\n* tot\n\nExample:\n```\nCRI_PROTOCOL_VERSION=1-2 mix compile\nCRI_PROTOCOL_VERSION=1-3 mix compile\nCRI_PROTOCOL_VERSION=tot mix compile\n```\n\n## Usage\n\n\u003e Note: In these examples, it assumes you're already running chrome headless with remote debugging enabled.\n\n```bash\nchrome --headless --disable-gpu --remote-debugging-port=9222\n```\n\n\u003e Basic API\n\n```elixir\n# ChromeRemoteInterface works off by creating a Session to the remote debugging port.\n# By default, connects to 'localhost:9222\niex(1)\u003e server = ChromeRemoteInterface.Session.new()\n%ChromeRemoteInterface.Server{host: \"localhost\", port: 9222}\n\niex(2)\u003e {:ok, pages} = ChromeRemoteInterface.Session.list_pages(server)\n{:ok,\n [%{\"description\" =\u003e \"\",\n    \"devtoolsFrontendUrl\" =\u003e \"/devtools/inspector.html?ws=localhost:9222/devtools/page/d4357ff1-47e8-4e53-8289-fc54089da33e\",\n    \"id\" =\u003e \"d4357ff1-47e8-4e53-8289-fc54089da33e\", \"title\" =\u003e \"Google\",\n    \"type\" =\u003e \"page\", \"url\" =\u003e \"https://www.google.com/?gws_rd=ssl\",\n    \"webSocketDebuggerUrl\" =\u003e \"ws://localhost:9222/devtools/page/d4357ff1-47e8-4e53-8289-fc54089da33e\"}]}\n\n# Now that we have a list of pages, we can connect to any page by using their 'webSocketDebuggerUrl'\niex(3)\u003e first_page = pages |\u003e List.first()\niex(4)\u003e {:ok, page_pid} = ChromeRemoteInterface.PageSession.start_link(first_page)\n\n# Any methods from https://chromedevtools.github.io/devtools-protocol/1-2/ should be available\n# to execute on that Page.\n\n# 'Page.navigate'\niex(5)\u003e ChromeRemoteInterface.RPC.Page.navigate(page_pid, %{url: \"https://google.com\"})\n%{\"id\" =\u003e 1, \"result\" =\u003e %{\"frameId\" =\u003e \"95446.1\"}}\n\n# 'Page.printToPDF'\niex(6)\u003e ChromeRemoteInterface.RPC.Page.printToPDF(page_pid, %{})\n{:ok, %{\"id\" =\u003e 2, \"result\" =\u003e %{\"data\" =\u003e \"JVBERi0xLj...\"}}}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewvy%2Fchrome-remote-interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewvy%2Fchrome-remote-interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewvy%2Fchrome-remote-interface/lists"}