title: How to pass Desired Capabilities to Undetected Chromedriver with Selenium Python?
body: <p>I'm using the Python package <a href="https://github.com/ultrafunkamsterdam/undetected-chromedriver" rel="noreferrer">Undetected Chromedriver</a> as I need to be able to log into a Google account with the webdriver, and I want to pass the options <code>{&quot;credentials_enable_service&quot;: False, &quot;profile.password_manager_enabled&quot;: False}</code> to the driver so that it doesn't bring up the popup to save the password. I was trying to pass those options using:</p>
  <pre><code>import undetected_chromedriver.v2 as uc
  
  uc_options = uc.ChromeOptions()
  uc_options.add_argument(&quot;--start-maximized&quot;)
  uc_options.add_experimental_option(&quot;prefs&quot;, {&quot;credentials_enable_service&quot;: False, &quot;profile.password_manager_enabled&quot;: False})
  
  driver2 = uc.Chrome(options=uc_options)
  </code></pre>
  <p>The argument <code>--start-maximized</code> works perfectly fine, and if I run the code with just that it starts maximised as intended. However, when adding the experimental options and running the code it returns the error:</p>
  <pre><code>selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: cannot parse capability: goog:chromeOptions
  from invalid argument: unrecognized chrome option: prefs
  </code></pre>
  <p>So I thought that I would try to pass the arguments as Desired Capabilities instead, making the code:</p>
  <pre><code>import undetected_chromedriver.v2 as uc
  
  uc_options = uc.ChromeOptions()
  uc_options.add_argument(&quot;--start-maximized&quot;)
  uc_options.add_experimental_option(&quot;prefs&quot;, {&quot;credentials_enable_service&quot;: False, &quot;profile.password_manager_enabled&quot;: False})
  uc_caps = uc_options.to_capabilities()
  
  driver2 = uc.Chrome(desired_capabilities=uc_caps)
  </code></pre>
  <p>While this code runs and doesn't generate any errors, it also doesn't do anything at all. The password popup still shows up, and the driver doesn't even start maximised, despite the fact that the latter part worked as an option.</p>
  <p>So my question is: how do I correctly pass Desired Capabilities to the Undetected Chromedriver?
  Or, alternatively: how do I correctly pass the Experimental Options to the Undetected Chromedriver?</p>