maxwell / screencap

A gem to screencap webpages in ruby. Uses Phantom.js under the hood.
MIT License
179 stars 63 forks source link

Add ability to render fixed height screen capture #2

Closed DEfusion closed 10 years ago

DEfusion commented 10 years ago

Due to the way PhantomJS render() renders pages (see https://github.com/ariya/phantomjs/issues/10619) if we want a specific height rendered screen capture of the entire page we need to workaround that issue.

This change renders the page within an <object> tag when called with a height option, I also re-factored the JavaScript to clean it up and clarify a few things.

DEfusion commented 10 years ago

Actually think I've come up with a cleaner way of doing this so closing this pull request.

maxwell commented 10 years ago

ok, feel free to push to master if you want!