Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

Puppeteer DownloadPolicy: Download Options Explained

Puppeteer has four runtime download policies. Learn what each does, when to set downloadPath, and why page downloads are separate from browser installation.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer’s DownloadPolicy controls files that a page tries to download while the browser is running. Choose deny to block downloads, allow to save them in a configured directory, allowAndName to save them under download GUIDs, or default to defer to Chrome’s default behavior when available (otherwise downloads are denied). For either allowing policy, configure downloadPath.

What does Puppeteer DownloadPolicy control?

DownloadPolicy is the runtime browser setting for whether pages controlled by Puppeteer may initiate file downloads. The four documented values in Puppeteer 25.12.0 are deny, allow, allowAndName, and default. This setting is about page downloads, not whether Puppeteer downloads a browser during installation.

As an Amazon Associate I earn from qualifying purchases.

Which download policy should you use?

Policy Effect Path and filename behavior Use it when
deny Denies all download requests. No download directory is needed. Your automation should not save files.
allow Allows download requests. Set downloadPath to choose the save directory. Browser filename behavior is used. You need downloads in a known directory and want the browser’s filename behavior.
allowAndName Allows download requests. Requires downloadPath; files are named with download GUIDs, not the website’s suggested filenames. Your workflow can track GUIDs and does not depend on the original filenames.
default Uses Chrome’s default behavior if available; otherwise denies downloads. Delegates the outcome to the browser’s available default behavior. You specifically want browser-default behavior rather than an explicit allow or deny.

The policy meanings and path requirements are documented in the Puppeteer DownloadBehavior API and DownloadPolicy type (Puppeteer 25.12.0).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure the policy in Puppeteer

When launching a locally managed Puppeteer browser, pass the download behavior through the launch options. Set a path for either policy that allows downloads:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  downloadBehavior: {
    policy: 'allow',
    downloadPath: '/absolute/path/to/downloads',
  },
});

try {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  // Trigger the page's download here.
} finally {
  await browser.close();
}

Replace the example path with a directory that exists and is writable by the process running Chromium. To block page downloads, use policy: 'deny' and omit the path. To accept GUID filenames, change the policy to 'allowAndName'; a configured path remains required. The optional downloadBehavior on ConnectOptions is documented as setting the behavior for the connected context; consult the ConnectOptions API for the Puppeteer version in use.

What changes at the Chrome DevTools Protocol level?

The underlying Chrome DevTools Protocol method is Browser.setDownloadBehavior. It supports a browserContextId; if omitted, the behavior applies to the default browser context. Its eventsEnabled parameter defaults to false. The protocol reference marks this method experimental, so its status and details may change across Chromium releases. See the Chrome DevTools Protocol Browser reference.

Runtime downloads are not Puppeteer installation downloads

Changing DownloadPolicy does not control the browser binary Puppeteer obtains during package installation. The installation guide says the puppeteer package normally downloads a compatible browser, while puppeteer-core does not download Chrome and is intended for setups where you manage the browser or connect to a remote one. If install scripts are blocked, the guide gives npx puppeteer browsers install as a manual installation command. These are installation concerns, separate from files downloaded by pages at runtime; see the Puppeteer installation guide.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

If your goal is a screenshot rather than browser automation, ScreenshotNeo provides a website screenshot API and MCP server. A single request returns an image or PDF; its clean-shot steps can accept consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server offers screenshot and PDF tools for AI agents.

cURL example, with the API details in the ScreenshotNeo documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo’s Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does allowAndName preserve the filename suggested by a website?

No. It names downloads using their download GUIDs.

Does DownloadPolicy configure Chrome’s installation download?

No. It governs downloads initiated by pages in a running browser, not Puppeteer’s browser installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.