Skip to content

Issue when using incognito: false and flatten: false #542

@obevanken

Description

@obevanken

Describe the bug

If incognito is disabled and flatten is disabled, an error occurs:

undefined method 'find_target' for nil (NoMethodError)

To Reproduce

browser = Ferrum::Browser.new(headless: false, incognito: false, flatten: false)
from ferrum/contexts.rb:98:in `block in subscribe': undefined method `find_target' for nil (NoMethodError)

           (target = @contexts[context_id].find_target { |t| t.connected? && t.page.frame_by(id: info["targetId"]) })
                                          ^^^^^^^^^^^^
from ferrum/client/subscriber.rb:77:in `block in call'
from ferrum/client/subscriber.rb:75:in `each'
from ferrum/client/subscriber.rb:75:in `each_with_index'
from ferrum/client/subscriber.rb:75:in `call'
from ferrum/client/subscriber.rb:56:in `block (2 levels) in start'
from <internal:kernel>:187:in `loop'
from ferrum/client/subscriber.rb:52:in `block in start'
from ferrum/utils/thread.rb:13:in `block in spawn'

Desktop

  • OS: [Linux v22.04.5]
  • Browser [Chrome Version 138.0.7204.49 (Official Build) (64-bit)]
  • Ruby version [v 3.3.5]
  • Version [v 0.17.1]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions