"Data Breach" popup on Chrome breaks my Web bot

Hello,

I’m trying to use the Web framework with Python to fully automate a task which needs logging into a MS account. I’ve coded from start to finish, tested some times, and didn’t have any problems… Until Chrome started showing the data breach popup as soon as I passed the password. It started seemingly randomly, and never stopped since.

I tried passing some options, tried also disabling directly into Chrome browser configuration the option itself, but had no success. I’m not too familiar with web-based testing and automation such as Selenium, so I dont know where or if I messed up.

I’ve scrapped online for some options to disable this popup and so far I’ve found nothing that actually works.

I know I could use an instanced Desktop Bot just to click on it but the final intention is to run it on headless mode for concurrency.

Snippet code i’ve used so far below:

from botcity.web import WebBot, Browser
from selenium.webdriver.chrome.options import Options as default_options

bot = WebBot()

class Bot(WebBot):
def action(self, execution=None):

    self.headless = False
    self.browser=Browser.CHROME
    self.driver_path = "C:/Program Files/chromedriver/chromedriver.exe"

    def_options = default_options()
    def_options.add_argument("--headless=new") 
    def_options.add_argument("--window-size=1980,1080")
    def_options.add_argument("--disable-features=PasswordLeakDetection")
    def_options.add_argument("--disable-features=PasswordChange")
    def_options.add_argument("--password-store=basic")
    def_options.add_argument("--disable-features=PasswordImport")
    def_options.add_argument("--disable-features=PasswordGeneration")   
    def_options.add_argument("--credentials_enable_service=false")
    def_options.add_argument("--profile.password_manager_enabled=false")
    def_options.add_argument("-private")
    self.browser_options = def_options
    self.start_browser()

Hello @lukethebr,

I did some quick tests, and using these arguments in the browser options, the pop-up stopped appearing for me:

bot = WebBot()
bot.headless = False
bot.browser = Browser.CHROME
    
def_options = default_options()
def_options.add_argument("--disable-blink-features=AutomationControlled")
def_options.add_argument("--disable-features=IsolateOrigins,site-per-process")
def_options.add_argument("--disable-features=PasswordManagerPreventAutoSignIn")
def_options.add_argument("--disable-save-password-bubble")
def_options.add_argument("--disable-extensions")
def_options.add_argument("--no-default-browser-check")
def_options.add_argument("--disable-popup-blocking")
def_options.add_argument("--disable-default-apps")
def_options.add_argument("--disable-infobars")

bot.options = def_options
...

Some other alternatives you can also try:

If you still have problems, you can try using another browser.

  • The BotCity Web Framework supports the use of UNDETECTED CHROME, which is basically a version of Chrome that contains some additional flags and settings to avoid possible detections and blocks. In the code, you would just need to change this line:
    bot.browser = Browser.UNDETECTED_CHROME

  • Another alternative could be to try using FIREFOX as well if Chrome is not specifically necessary in your process.