rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.71k stars 123 forks source link

Ferrum::ProcessTimeoutError #263

Closed aditya-kapoor closed 2 years ago

aditya-kapoor commented 2 years ago

The seems to be having issues with the Firefox on MacOS Mojave installation. The following code snippet open the Firefox window but returns the Ferrum::ProcessTimeoutError (Browser did not produce websocket url within 5 seconds, try to increase:process_timeout. See https://github.com/rubycdp/ferrum#customization)

require 'ferrum'
 => true
browser = Ferrum::Browser.new(browser_name: :firefox, headless: false, process_timeout: 5)
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Traceback (most recent call last):
       11: from /Users/adityakapoor/.rvm/rubies/ruby-2.6.5/bin/irb:23:in `<main>'
       10: from /Users/adityakapoor/.rvm/rubies/ruby-2.6.5/bin/irb:23:in `load'
        9: from /Users/adityakapoor/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
        8: from (irb):2
        7: from (irb):2:in `new'
        6: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser.rb:63:in `initialize'
        5: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser.rb:125:in `start'
        4: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser/process.rb:30:in `start'
        3: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser/process.rb:30:in `tap'
        2: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser/process.rb:95:in `start'
        1: from /Users/adityakapoor/.rvm/gems/ruby-2.6.5/gems/ferrum-0.11/lib/ferrum/browser/process.rb:149:in `parse_ws_url'
Ferrum::ProcessTimeoutError (Browser did not produce websocket url within 5 seconds, try to increase `:process_timeout`. See https://github.com/rubycdp/ferrum#customization)
route commented 2 years ago

Firefox is not supported now, there's only draft code but I barely tested it.