Open jubishop opened 2 years ago
based on my understanding from articles like https://medium.com/@jbbpatel94/difference-between-offsetheight-clientheight-and-scrollheight-cfea5c196937 this makes sense that it should be scrollHeight..
I also noticed adding options[:captureBeyondViewport] = true
was necessary to always get the full screenshot. gotten from https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
Been running this a 3-4 months in a big codebase, and it works a charm. Anything else needed for this to be merged?
I noticed that the bottom of my screenshots were getting cut off...it wasn't expanding quite far enough. When I switched to
cuprite
, however, it would work and capture the entire viewport properly. I studied the difference andcuprite
is usingscrollWidth
andscrollHeight
at https://github.com/rubycdp/ferrum/blob/3253bf1d028945b434ffb8e3d42636342ebf15bc/lib/ferrum/page/screenshot.rb#L66