title: Cannot download file in headless chrome
body: <p>I'm trying to download a file using headless chrome.</p>
  
  <p>In normale mode, it works without problem, 
  but in headeless, no matter what prefs or options I set, it doesn't download the pdf without any exception or error.</p>
  
  <pre><code> ChromeDriverService service = ChromeDriverService.CreateDefaultService();
              service.HideCommandPromptWindow = true;
  
              ChromeOptions options = new ChromeOptions();
  
              options.AddArgument("--ignore-certificate-errors");
              options.AddArgument("--disable-popup-blocking");
              options.AddArgument("--disable-infobars");
              options.AddArgument("--disable-extensions");
              options.AddArgument("--disable-default-apps");
              options.AddArgument("--disable-gpu");
              options.AddArgument("--window-size=1920,1080");
              options.AddArgument("--user-agent=Chrome/73.0.3683.103");
              options.AddArgument("--headless");
              options.AddUserProfilePreference("download.default_directory",downloadsPath); 
  
  options.AddUserProfilePreference("download.prompt_for_download",false);            
  options.AddUserProfilePreference("safebrowsing.disable_download_protection",true);            options.AddUserProfilePreference("plugins.always_open_pdf_externally", true);
  
              IWebDriver driver = new ChromeDriver(service, options);
              driver.Manage().Cookies.DeleteAllCookies();
              var enableDownloadCommandParameters = new Dictionary&lt;string, object&gt;
              {
                  { "behavior", "allow" },
                  { "downloadPath", downloadsPath }
              };
              object  rt = ((ChromeDriver)driver).ExecuteChromeCommandWithResult("Page.setDownloadBehavior", enableDownloadCommandParameters);
  </code></pre>