title: How to enable flash in Selenium with headless chrome
body: <p>I'm trying to automate some interactions with our flash app as part of our CI process.  I'm running into troubles with enabling flash when running chrome headlessly (via xvfb-run) with Selenium Standalone Server.  I've done a lot of searching, but thus far haven't come up with anything that works.</p>
  
  <p>I'm currently using this, but am open to switching to different versions if there's a known working config somewhere...</p>
  
  <ul>
  <li>Selenium Standalone Server 3.11 </li>
  <li>Chromedriver 2.33 </li>
  <li>Chrome 65.0.3325.181 </li>
  <li>Java 8</li>
  </ul>
  
  <p>When I first got this started I would get a warning on the page saying I needed to enable Adobe Flash Player.  I got "past" that message by using the following from <a href="https://sqa.stackexchange.com/questions/30312/enable-flash-player-on-chrome-62-while-running-selenium-test">https://sqa.stackexchange.com/questions/30312/enable-flash-player-on-chrome-62-while-running-selenium-test</a>:</p>
  
  <pre><code>    ChromeOptions options = new ChromeOptions();
      options.addArguments("headless");
  
      Map&lt;String, Object&gt; prefs = new HashMap&lt;String, Object&gt;();
      prefs.put("profile.default_content_setting_values.plugins", 1);
      prefs.put("profile.content_settings.plugin_whitelist.adobe-flash-player", 1);
      prefs.put("profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player", 1);
      // Enable Flash for this site
      prefs.put("PluginsAllowedForUrls", "ourapp.com");
      options.setExperimentalOption("prefs", prefs);
  
      WebDriver driver = new ChromeDriver(options);
      driver.get("ourapp.com");
  </code></pre>
  
  <p>When loading our app, the page now gives a slightly different message which I haven't been able to get past.  Is there a way to get around this, or is there any other way to enable Flash by default?</p>
  
  <p><a href="https://i.stack.imgur.com/DXDNz.png" rel="nofollow noreferrer">Restart Chrome to enable Adobe Flash Player</a></p>
  
  <p>Thanks in advance for the help!</p>