title: Run Flash Webpage in Headless Chrome on Ubuntu 14.04
body: <p>I am trying to run my Cucumber tests headlessly with Chrome on Ubuntu 14.04 (EC2 instance so no GUI). So far my setup allows this, as the below screenshot shows:</p>
  
  <p><a href="https://i.stack.imgur.com/WXkyR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WXkyR.png" alt="Successful Screenshot"></a></p>
  
  <p>I have an issue when I come to a page with flash on it:</p>
  
  <p><a href="https://i.stack.imgur.com/NEX49.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NEX49.png" alt="Flash page"></a></p>
  
  <p>I have restarted the EC2 instance and killed all chrome processes, still no joy.</p>
  
  <p>To clarify, a test will start and chrome opens the page with flash on it and I get this message. If I then end the test and start it again I get the same problem. I guess this is not actually restarting chrome as it is a new instance each time?</p>
  
  <p>So to run these tests I am using the <code>headless</code> gem <a href="https://github.com/leonid-shevtsov/headless" rel="nofollow noreferrer">here</a> which acts as the interface to <code>xvfb</code>.</p>
  
  <p>I have <code>Google Chrome 57.0.2987.133</code> and have added <code>libflashplayer.so</code> to <code>/opt/google/chrome/plugins</code>using this <a href="https://askubuntu.com/questions/14629/how-do-i-enable-the-partner-repository">https://askubuntu.com/questions/14629/how-do-i-enable-the-partner-repository</a></p>
  
  <p>A few extras things I have tried include:</p>
  
  <pre><code>sudo apt-get install pepperflashplugin-nonfree
  sudo update-pepperflashplugin-nonfree --install
  </code></pre>
  
  <p>Is there a way to get this to work so I can render flash based sites? Do I need to enable the flash plugin each time I open chrome? I'm hoping I've missed something obvious.</p>
  
  <h3>Update</h3>
  
  <p>I have tried setting the <code>pepperflashpluginpath</code> when creating the Chrome profile but this is still not working:</p>
  
  <pre><code>Capybara.register_driver :chrome do |app|
    chrome_binary = '/usr/bin/google-chrome'
  
    Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" =&gt; { "binary" =&gt; chrome_binary, "args" =&gt; ["--ppapi-flash-path=/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so"] })
    Capybara::Selenium::Driver.new(app, :browser =&gt; :chrome, :desired_capabilities =&gt; capabilities)
  end
  </code></pre>
  
  <p>Thanks</p>