Skip to content

A Go module for a ChromeDP abstraction layer that additionally hosts a webserver to remotely view ChromeDP sessions. Essentially opening a "portal" to the page. Perfect for Go automations that require manual intervention. Inspired by https://github.com/claabs/puppeteer-extra-plugin-portal.

License

Notifications You must be signed in to change notification settings

jarylc/go-chromedpproxy

Repository files navigation

ChromeDP Proxy

Go ChromeDPProxy

Inspired by claabs/puppeteer-extra-plugin-portal

A Go module for a ChromeDP abstraction layer that additionally hosts a webserver to remotely view ChromeDP sessions. Essentially opening a "portal" to the page. Perfect for Go automations that require manual intervention.

IMPORTANT: You must install xvfb on the system / docker container

Report Bugs · Request Features

About The Project

Built With

Examples

Please proceed to the examples directory

Getting Started

Installing

go get github.com/jarylc/go-chromedpproxy

Usage

Basic

// step 1 - prepare proxy
// change `:9222` to your desired Chrome remote debugging port
// change `:9221` to your desired webserver port for the front-end
// append and/or remove `chromedp.DisableGPU` with your desired allocated executor options as additional arguments
chromedpproxy.PrepareProxy(":9222", ":9221", chromedp.DisableGPU)

// step 2 - launch a tab target
// append and/or remove `chromedp.WithLogf(log.Printf)` with your desired context options as additional arguments
targetID, err := chromedpproxy.NewTab("https://www.google.com/recaptcha/api2/demo", chromedp.WithLogf(log.Printf))
if err != nil && !errors.Is(err, context.Canceled) {
    log.Fatal(err)
}
defer chromedpproxy.CloseTarget(targetID)

// step 3 - get context and do whatever you need, you can refer to the examples directory of the project
ctx := chromedpproxy.GetTarget(targetID)
// ...

ChromeDP

Please refer to chromedp/chromedp repository for general chromedp usage

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Feel free to fork the repository and submit pull requests.

License

Distributed under the GNU GENERAL PUBLIC LICENSE V3. See LICENSE for more information.

Contact

Jaryl Chng - git@jarylchng.com

https://jarylchng.com

About

A Go module for a ChromeDP abstraction layer that additionally hosts a webserver to remotely view ChromeDP sessions. Essentially opening a "portal" to the page. Perfect for Go automations that require manual intervention. Inspired by https://github.com/claabs/puppeteer-extra-plugin-portal.

Topics

Resources

License

Stars

Watchers

Forks

Languages