rubycdp / ferrum

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

Add screencast functionality #494

Open bradleyscollins opened 1 month ago

bradleyscollins commented 1 month ago

This pull request adds an API that exposes CDP's screencast capability.

See the following:

Note: At this time, the Chrome DevTools Protocol documentation still has screencast methods/types marked as "experimental."

bradleyscollins commented 1 month ago

A number of the test failures are on account of a difference between expected vs. actual screenshot height.

We noticed that as of Chrome 128, the heights of our screenshot/screencast images were different from (less than) the height specified in the window_size option of the Browser constructor. We had to set the viewport size explicitly to get the expected screenshot height.