Repository navigation
v0.19.0
This release moves the example programs to chromedp v0.19.0 and adds 17 new programs, so there are 41 now. The tags of this repository follow the tags of chromedp: v0.19.x holds programs that use chromedp v0.19, and a point release such as v0.19.1 is a later change in this repository.
New programs
All the new programs use a local server and need no internet.
- Network, sessions and files:
interceptblocks, mocks and changes requests with the Fetch domain.sessionsaves a login session and restores it in another browser.harwrites a HAR file from the network events of a page.pdfstreamreads a printed PDF as a stream.screencastsaves the frames of a page as JPEG files. - Pages and events:
framesreaches elements inside an iframe and a shadow root.dialogsanswers alert, confirm, prompt andbeforeunloaddialogs.popupsworks with popups, several targets and browser contexts.eventsiterreads events with iterators and waits for the network to be idle.consolereads the console and the uncaught exceptions. - New helpers of chromedp v0.19:
dragdropusesDragAndDropfor mouse and HTML5 drags.exposefunccalls Go functions from the page withExposeFunc.pdfoptionsprints PDF files with the newPrintToPDFoptions. - The typed API:
structevaldecodes JavaScript results into Go values.selectorscompares the typed selectors.rawcallsends protocol commands that have no action.workersruns many jobs in parallel in one browser. tabswas new in v0.18.0. It now has the flag-tabs-in-one-window.
Other changes
- The programs require
chromedpv0.19.0,cdprotov0.157.5 andchromedp/remotev0.1.0. - The program
frameswaits withWaitNotPresent, which works with aJSPathexpression that gives null sincechromedpv0.19.0. - The README names the programs that need no internet. The 26 programs that name no live site were run against the released versions before this tag.
- 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 many of them read live websites.
Notes
- Some programs read live websites, and they can fail when a site changes.
- Run a program with
go run, for examplego run github.com/chromedp/examples/dragdrop@v0.19.0.