INNER CODE UNIT · Ruby

debug_url

rubycdp/ferrum · lib/ferrum/browser.rb:322

    def debug_url
      response = JSON.parse(Net::HTTP.get(URI(build_remote_debug_url(path: "/json"))))

      devtools_frontend_path = response[0]&.[]("devtoolsFrontendUrl")
      raise "Could not generate debug url for remote debugging session" unless devtools_frontend_path

      build_remote_debug_url(path: devtools_frontend_path)
    end

    def build_remote_debug_url(path:)
      return path if Addressable::URI.parse(path).absolute?

      "http://#{process.host}:#{process.port}#{path}"
    end
  end
end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…