title: Webdriver - Can't use headless mode in Firefox when using preferences
body: <p>I want to launch Firefox headlessly through Selenium, but I can't seem to find a way to do so and keep my preferences at the same time.</p>
  
  <pre><code>from selenium import webdriver;
  from selenium.webdriver import Firefox;
  
  cProfile = webdriver.FirefoxProfile();
  options = webdriver.FirefoxOptions();
  dwnd_path = os.getcwd();
  
  options.add_preference('browser.download.folderList', '2');
  options.add_preference('browser.download.manager.showWhenStarting', 'false');
  options.add_preference('browser.download.dir', 'dwnd_path');
  options.add_preference('browser.helperApps.neverAsk.saveToDisk', 'application/octet-stream,application/vnd.ms-excel');
  </code></pre>
  
  <p>Running this, I will get this error: </p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 17, in &lt;module&gt;
      options.add_preference('browser.download.folderList', '2');
  AttributeError: 'Options' object has no attribute 'add_preference'
  </code></pre>
  
  <p>Any ideas?</p>