rubycdp / ferrum

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

Fix: Do not expect response for initiatorType Ping requests #417

Closed MC-Squared closed 6 months ago

MC-Squared commented 7 months ago

Motivation

HTML supports adding a ping attribute to <a> tags. In such cases, the browser sents a POST request to the set URL(s) before navigating to the new URL (See w3schools doc here and Mozilla docs on initiatorType which includes ping as an option). Unfortunately, because these requests do not receive a server response Ferrum adds them to the list of pending_connections, meaning that subsequent calls to wait_for_idle will timeout waiting for these never-will-complete requests.

Changes

route commented 7 months ago

Could you add a proper test with tag?

route commented 7 months ago

ping

MC-Squared commented 7 months ago

Updated - I have guessed a bit on where best to locate the new specs so if they need to be moved/re-arranged just let me know

route commented 6 months ago

Thanks! Merging, though I have some patch to apply on it after merging.