rubycdp / ferrum

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

What is the purpose of navigation awaiting in `Page.command` method? #450

Closed lsndr closed 3 months ago

lsndr commented 3 months ago

I'd like to understand why this logic is present here:

https://github.com/rubycdp/ferrum/blob/5271866198dad526ca898344459f1a5afa2efafb/lib/ferrum/page.rb#L344-L353

I see that wait param passed in go_to method and some methods related to mouse events.

So basically it means if I click on element and navigation happens after down event, the click will fail if navigation doesn't finish within timeout despite the click was successful and led to navigation.

Shouldn't be this "wait for navigation" logic controlled by client and not included in mouse class?

route commented 3 months ago

Please consider Discussion for all kind of questions, issues should not be used like that