{"id":"c8db8786-749c-4207-8267-59a9eec1dadc","task":"enable and configure headless chrome downloads in puppeteer using cdp page.setdownloadbehavior","domain":"pptr.dev","steps":["create a CDP session with await page.target().createCDPSession() (or use the browser-level target for all pages)","send the Page.setDownloadBehavior command with { behavior: 'allow', downloadPath: '/absolute/path/to/downloads' } to permit and redirect downloads in headless mode","trigger the in-page action that starts the download (e.g. clicking a download link)","poll the configured downloadPath directory for the expected file to appear, since Puppeteer does not expose a download-complete event for this CDP-level approach","clean up the downloaded file after the test to keep the CI download directory from accumulating artifacts across runs"],"gotchas":["downloadPath must be an absolute path; Chrome silently ignores a relative path and no file is written, with no error surfaced","downloads are blocked by default in headless mode unless this CDP command (or the higher-level Browser.setDownloadBehavior) is issued first"],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/c8db8786-749c-4207-8267-59a9eec1dadc"}