How to disable xdg-open popup in Puppeteer?
PuppeteerTo stop the xdg-open popup in Puppeteer, configure a Chrome policy URLAllowlist and use a Chrome binary that reads that policy.
-
Use a Chrome installation outside of npm or pnpm and point Puppeteer to it, for example executablePath: "/etc/opt/chrome/chrome".
-
Create a managed policy file to allow URLs. Place it at /etc/opt/chrome/policies/managed/url_allowlist.json with content:
{
"URLAllowlist": ["http://*", "https://*"]
}
- 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.