https://github.com/mkenney/go-chrome
A golang library for interacting with the Chrome DevTools Protocol. https://chromedevtools.github.io/devtools-protocol/
https://github.com/mkenney/go-chrome
chrome chrome-debugging-protocol chrome-devtools chrome-devtools-protocol devtools devtools-protocol golang headless websocket
Last synced: 26 days ago
JSON representation
A golang library for interacting with the Chrome DevTools Protocol. https://chromedevtools.github.io/devtools-protocol/
- Host: GitHub
- URL: https://github.com/mkenney/go-chrome
- Owner: mkenney
- License: bsd-2-clause
- Created: 2017-10-28T21:03:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-12T20:35:07.000Z (almost 4 years ago)
- Last Synced: 2025-08-13T21:14:07.738Z (6 months ago)
- Topics: chrome, chrome-debugging-protocol, chrome-devtools, chrome-devtools-protocol, devtools, devtools-protocol, golang, headless, websocket
- Language: Go
- Homepage:
- Size: 3.93 MB
- Stars: 125
- Watchers: 9
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# go-chrome
This package aims to be a complete [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) implementation. The primary use-case behind this project is interacting with [headless Google Chrome](https://developers.google.com/web/updates/2017/04/headless-chrome) in a container environment, but it should be appropriate for developing server side and desktop applications for any browser that supports the devtools protocol.
The API is fairly settled and basic code-coverage tests have been implemented but real-world testing is needed. [`Page.captureScreenshot`](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot) and related calls are working well and are regularly used for validating the viability of code changes.
This implementation is based on the [Tip-of-Tree](https://chromedevtools.github.io/devtools-protocol/tot/) documentation and may be prone to change. At some point stable versions will be implemented as well, hopefully beginning with v1.3.
# Documentation and Examples
There are a few small examples of how to use the framework API on the [wiki](https://github.com/mkenney/go-chrome/wiki) and in the [`/_examples`](https://github.com/mkenney/go-chrome/tree/master/_examples) directory. Additional documentation is available on the [wiki](https://github.com/mkenney/go-chrome/wiki) as well.
# TODO
Contributions of any kind are very welcome!
* Resolve [race condition issues](https://github.com/mkenney/go-chrome/pull/119). Any assistance is appreciated!
* Add framework API examples to the `/_examples` directory and wiki to showcase various ways people are using the package.
Any example scripts showing various ways people are using the framework would be outstanding! The [screenshot script](https://github.com/mkenney/go-chrome/tree/master/_examples/screenshot-url) and several others are available there.
* Refactoring to implement standard interfaces where applicable and review current use of interfaces in the API. Some aren't needed at all and others are used to support test mocks.
* Add more tests, particularly for error cases.
* Add integrated tests to stablize package interactions raised in various issues.
If you would like to contribute but aren't sure how, take a look at the [issue tracker](https://github.com/mkenney/go-chrome/issues). Issues are labeled as bug reports, feature requests, feedback requests, help wanted, etc.
There are also always [tests that could be written](https://codecov.io/gh/mkenney/go-chrome). There are [many](https://github.com/mkenney/go-chrome/blob/master/tot/socket/cdtp.animation_test.go) [examples](https://github.com/mkenney/go-chrome/blob/master/tot/cdtp/animation/enum.animation.type_test.go) of tests in the package.
# [`CHANGELOG`](CHANGELOG.md)
All notable changes to this project are documented in the [`CHANGELOG`](CHANGELOG.md). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
