![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/2mjolk/chromedp
Package chromedp is a faster, simpler way to drive browsers supporting the Chrome DevTools Protocol in Go without external dependencies (like Selenium or PhantomJS).
Install in the usual Go way:
go get -u github.com/chromedp/chromedp
Refer to the GoDoc page for the documentation and examples. Additionally, the examples repository contains more complex examples.
I can't see any Chrome browser window
By default, Chrome is run in headless mode. See DefaultExecAllocatorOptions
, and
an example
to override the default options.
I'm seeing "context canceled" errors
When the connection to the browser is lost, chromedp
cancels the context, and
it may result in this error. This occurs, for example, if the browser is closed
manually, or if the browser process has been killed or otherwise terminated.
Chrome exits as soon as my Go program finishes
On Linux, chromedp
is configured to avoid leaking resources by force-killing
any started Chrome child processes. If you need to launch a long-running Chrome
instance, manually start Chrome and connect using RemoteAllocator
.
Executing an action without
Run
results in "invalid context"
By default, a chromedp
context does not have an executor, however one can be
specified manually if necessary; see issue #326
for an example.
I can't use an
Action
withRun
because it returns many values
Wrap it with an ActionFunc
:
chromedp.Run(ctx, chromedp.ActionFunc(func(ctx context.Context) error {
_, err := domain.SomeAction().Do(ctx)
return err
}))
I want to use chromedp on a headless environment
The simplest way is to run the Go program that uses chromedp inside the
chromedp/headless-shell image. That image contains headless-shell
, a
smaller headless build of Chrome, which chromedp
is able to find out of the
box.
chromedp
examplesgithub.com/chromedp/cdproto
- GoDoc listing for the CDP domains used by chromedp
github.com/chromedp/cdproto-gen
- tool used to generate cdproto
github.com/chromedp/chromedp-proxy
- a simple CDP proxy for logging CDP clients and browsersFAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.