title: Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME when rendering jstree with with capybara and headless chrome
body: <p>Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug:</p>
  
  <p>There are dependencies in the Gemfile:</p>
  
  <pre><code># Gemfile
  gem 'capybara', '2.18.0'
  gem 'selenium-webdriver', '3.141.0'
  </code></pre>
  
  <p>It is the simple page which renders jstree:</p>
  
  <pre><code># jstree.html
  
  &lt;!doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script src="https://rawgit.com/jquery/jquery/1.12.4/dist/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://rawgit.com/vakata/jstree/3.3.7/dist/jstree.min.js"&gt;&lt;/script&gt;
      &lt;link href="https://rawgit.com/vakata/jstree/3.3.7/dist/themes/default/style.min.css" rel="stylesheet"/&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;h1&gt;This is a list:&lt;/h1&gt;
      &lt;ul id="tree"&gt;&lt;/ul&gt;
      &lt;script&gt;
        $('#tree').jstree({
          core: {
            data: [{ "id": 1, "state": {}, "text": "Example", "parent": "#" }]
          }
        });
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>There is a ruby script to open the page with Capybara and save page screenshot:</p>
  
  <pre><code># script.rb
  require 'capybara'
  
  require 'selenium-webdriver'
  Capybara.register_driver :chrome do |app|
    options = ::Selenium::WebDriver::Chrome::Options.new(
      args: %w[headless no-sandbox disable-dev-shm-usage window-size=1280,800])
  
    Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
  end
  
  Capybara.default_driver = :chrome
  Capybara.app = Rack::File.new File.expand_path('../', __FILE__)
  
  include Capybara::DSL
  visit '/jstree.html'
  page.save_and_open_screenshot
  </code></pre>
  
  <p>When I run <code>bundle exec ruby script.rb</code> and then open the screenshot I see the following:</p>
  
  <p><a href="https://i.stack.imgur.com/OAMON.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OAMON.jpg" alt="enter image description here"></a></p>
  
  <p>but when I open jstree.html in my chrome browser I see normal tree:</p>
  
  <p><a href="https://i.stack.imgur.com/0kcGf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0kcGf.png" alt="enter image description here"></a></p>
  
  <p>When I add output browser console messages to the end of the script</p>
  
  <pre><code>puts page.driver.browser.manage.logs.get(type)
  </code></pre>
  
  <p>and rerun <code>bundle exec ruby script.rb</code> I get </p>
  
  <pre><code>SEVERE 2018-12-27 16:24:23 +0300: blob:http://127.0.0.1:49346/26695642-8b26-494b-a142-54a515db6512 - Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
  </code></pre>
  
  <p>I am using chrome <code>v71</code> and chromedriver <code>v2.45</code></p>
  
  <p>Does anybody have any idea what is going on there?
  How can I fix this issue?</p>