How to disable xdg-open popup in Puppeteer?

Puppeteer

To stop the xdg-open popup in Puppeteer, configure a Chrome policy URLAllowlist and use a Chrome binary that reads that policy.

  1. Use a Chrome installation outside of npm or pnpm and point Puppeteer to it, for example executablePath: "/etc/opt/chrome/chrome".

  2. Create a managed policy file to allow URLs. Place it at /etc/opt/chrome/policies/managed/url_allowlist.json with content:

{
  "URLAllowlist": ["http://*", "https://*"]
}
  1. Restart Chrome and run Puppeteer again.

Notes:

  • Do not install Chrome via npm or pnpm.
  • If you want to restrict to specific domains, adjust the URLAllowlist accordingly.

This approach addresses the issue without changing Puppeteer version.