brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 285 forks source link

Allow to override the options during the takeShot callback #125

Open NBZ4live opened 8 years ago

NBZ4live commented 8 years ago

Sometimes it is useful to override some of the options per page basis.

This pull request makes it possible by allowing to override them when calling it as follows:

window.callPhantom({
    event: 'takeShot',
    options: {
        shotSize: {
            width: document.getElementsByTagName('html')[0].offsetWidth,
            height: document.getElementsByTagName('html')[0].offsetHeight
        }
    }
});