v0.18.0
This release moves all the example programs to the new API of chromedp v0.18.0. From now on, the tags of this repository follow the tags of chromedp: v0.18.x holds programs that use chromedp v0.18, and a point release such as v0.18.1 is a later change in this repository.
What changed
- All the programs use the typed API:
chromedp.Doandchromedp.Runreturn values,chromedp.Eventsreads events, andcdp.Callsends a protocol command. - The programs require
chromedpv0.18.0,cdprotov0.157.4 and the modulechromedp/remotev0.1.0. - Every program takes the flag
-vto print the protocol messages. Every program exceptremotetakes the flag-visibleto show the browser window and keep the browser open. The variableCHROMEDP_VISIBLEWINDOWdoes the same. - New program
tabs: it opens several tabs of one browser at the same time, shows that tabs share cookies unless a tab has its own browser context, and with-tabs-in-one-windowit opens real tabs in one window and switches between them. - The program
submitsearches Wikipedia, because DuckDuckGo shows a challenge to a headless browser. - The program
clickclicks the summary of the example on pkg.go.dev, and the programuploadruns from any directory. - The
remoteprogram andforecast -remoteuseremote.NewAllocator. - The README has the logo and the badges of
chromedp, a table that shows which programs need the internet, and a note on how to run a program. - GitHub Actions builds and vets every program on each push and pull request, and every night against the newest
chromedp. The workflows do not run the programs, because most of them read live websites.
Notes
- Some programs read live websites, and they can fail when a site changes. The programs
cookie,headers,keys,proxy,subtree,tabs,uploadandvisibleneed no internet. - Run a program with
go run, for examplego run github.com/chromedp/examples/tabs@v0.18.0.