chrome_policy is an optional object that applies Chrome enterprise policies to a browser. It works on both individual on-demand browsers (browsers.create()) and browser pools, where it applies to every browser in the pool. Use it to control startup behavior, default homepages, bookmarks, and other browser-level settings.
Keys are Chrome policy names and values are the corresponding settings. The same policies and value types apply on both paths. Kernel-managed policies (extensions, proxy, and CDP/automation) are rejected, and the serialized payload is capped at 5 MiB.
Setting chrome policies on a pool
Pass achrome_policy object when creating or updating a pool.
Updating policies on an existing pool
You can updatechrome_policy on an existing pool. Pass discard_all_idle: true to immediately replace all idle browsers with the new policy configuration.
Example policies
The example above demonstrates setting a default homepage and managed bookmarks. Here’s what each policy does:Common use cases
The examples below usebrowsers.create(), but the same policies apply when set on a pool.
Allow pop-ups
Chrome’s default blocks pop-ups, which breaks sites that open download dialogs or OAuth windows in a new window. SetDefaultPopupsSetting to 1 to allow them (2 blocks).
Control file download behavior
When automating file downloads that trigger permission prompts, combineDefaultPopupsSetting: 1 with DownloadRestrictions: 0 to allow all downloads.
Block DevTools and page source
DevTools hands anyone who can reach a browser a console on the page, plus network logs, cookies, and local storage. When you expose a session through live view, or run agent code you don’t fully trust, block the URLs DevTools loads from:Restrict navigation to specific URLs
To lock a browser to an approved set of URLs, block everything withURLBlocklist and then allow back only the URLs you want with URLAllowlist. Entries match a whole domain (chatgpt.com) or a specific path (en.wikipedia.org/wiki/Cat), and more specific entries take precedence. This gates top-level navigation, so any other URL returns ERR_BLOCKED_BY_ADMINISTRATOR; it does not block resources or API calls a permitted page loads from other origins.
Print to PDF
PrintingEnabled must stay true (the default) for the browser’s print-to-PDF path — including CDP’s Page.printToPDF and Playwright’s page.pdf() — to work.
PrintPdfAsImageDefault controls whether each page is rasterized to an image before being placed in the PDF, rather than kept as native vector text and graphics:
false(shown explicitly below, and Chrome’s default) — keeps text selectable and extractable in the output PDF. Use this if automation will read the PDF’s contents afterward (text extraction, parsing, LLM ingestion) — image-based PDFs need OCR to get text back out.true— rasterizes every page, which can look more consistent on pages with complex CSS or canvas content, at the cost of searchable text and a larger file.
Available policies
Any policy listed in the Chrome Enterprise policy documentation can be used in thechrome_policy object. Refer to the official docs for the full list of supported policy names, types, and values.