When using Puppeteer to automate browser tasks, you may encounter a need to disable both the password manager popup and the “Chrome is being controlled by automated test software” info header. Achieving this can be a bit tricky since the solutions for each issue might interfere with one another. Here’s how you can disable both effectively.
Password Manager Popup: This popup appears when Chrome prompts you to save passwords. Disabling it can be achieved using the --password_manager_enabled=false
argument.
Info Header: This message appears at the top of the browser window indicating that the browser is being controlled by automated test software. This can be disabled using the ignoreDefaultArgs
option with the --enable-automation
flag.
To disable both the password manager popup and the info header, you need to combine the appropriate settings. Here’s how you can do it:
npm install puppeteer
args
and ignoreDefaultArgs
options in puppeteer.launch
. Here’s the code to achieve both:const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: [
'--password_manager_enabled=false',
'--no-sandbox', // Optional: Other arguments you might need
'--disable-setuid-sandbox'
],
ignoreDefaultArgs: ['--enable-automation']
});
const page = await browser.newPage();
await page.goto('https://example.com'); // Replace with your target URL
// Perform your automation tasks here
await browser.close();
})();
args
: This array includes --password_manager_enabled=false
to disable the password manager popup.ignoreDefaultArgs
: This array includes --enable-automation
to remove the “Chrome is being controlled by automated test software” message.By combining these settings, you can achieve a clean, distraction-free browser automation experience with Puppeteer. This approach allows you to maintain control over the browser without unnecessary prompts or messages interfering with your tasks.
Reference
https://pptr.dev/api/puppeteer.launchoptions
How can I get rid of this change password warning (It's on a private site that can't be reached without private key/password)
byu/jm0112358 inchrome
https://stackoverflow.com/questions/72878107/in-the-website-login-chrome-found-the-password-you-just-used-in-a-data-breach