alwex / php-casperjs

simple PHP wrapper for CasperJS
MIT License
182 stars 71 forks source link

Inject JS code in CasperJS script #31

Open jcontesse opened 7 years ago

jcontesse commented 7 years ago

I would like to inject JS code to the final script to do things not provided in this wrapper like:

casper.page.paperSize = {
    width: (8.5 * 96) + 'px',
    height: (11 * 96) + 'px',
    orientation: 'portrait',
    margin: '0px'
}

or any other code that might be needed. Something like:

$casper->addToScript(<<<FRAGMENT
... JS code ...
FRAGMENT);
alwex commented 7 years ago

Sounds like a good idea to be able to "support new casper JS features" between updates. Can you open a pull request?

alwex commented 7 years ago

Hi,

I have released v1.3.0 that come with this feature. I hope it is what you are after.