Puppeteer: How can I suppress Chrome's leaked password alert?

Using Puppeteer, I see a Chrome prompt warning about a compromised password even with flag options set. How can I programmatically disable this alert?

using System;
using AutoPuppeteerLib;
using System.Threading.Tasks;

class AutomationRunner
{
    public static async Task RunAsync()
    {
        var config = new BrowserConfig
        {
            ExecutablePath = "C:/Chrome/chrome.exe",
            Arguments = new string[] {
                "--turn-off-password-popup",
                "--disable-notifications",
                "--no-sandbox"
            },
            HeadlessMode = false
        };

        var browser = await AutoChrome.LaunchBrowserAsync(config);
        var tab = await browser.CreateNewTabAsync();
        await tab.NavigateToUrlAsync("https://example.com");
        Console.WriteLine("Browser launched without password breach notifications.");
    }
}

The password alert is hardwired into Chrome’s security features, which means even with several flags, it may not be entirely possible to disable these notifications programmatically. In my experience testing with Puppeteer, I found that although flags like --disable-notifications and --turn-off-password-popup help, Chrome can still trigger these alerts because they serve an important function. A more effective workaround might be to handle these events at runtime by intercepting dialog prompts, but note that this approach may require additional complexity in code.

try using the page.on(‘dialog’) event to capture and dismiss the alert. i’ve got that working for me when flag options alone didnt cut it. not perfect but it helps progammatically handle the popup.

In my experience, even after setting several flags in Puppeteer to handle password alerts, Chrome’s inherent security measures sometimes override these settings. I’ve had success by configuring a custom event listener within the automation script that intercepts and checks for such notification events. This method doesn’t completely eliminate the alert in every case, but it allows for a more subtle and controlled handling during runtime. Although not a perfect solution, blending configuration flags with event-based handling has provided a more reliable workaround for mitigating unwanted UI interruptions during automated testing.

Through my research and application, I’ve come to realize that Chrome’s alert about a leaked password is intricately tied to its security framework. Adding flag options such as disabling notifications can only mitigate part of the issue and might not suffice on its own. In one particular project, I implemented a strategy that combined initial flag settings with the interception of dialog prompts at runtime. While this method does not completely suppress the alert in every case, it ensures a smoother automation flow by minimizing interference from unwanted pop-ups during testing.

i found that using a custom chrome user-data-dir can bypass these alerts. try creating a fresh profile to see if it helps. changing this setting seems to work better than flags alone for my automation runs.