This functionality allows you to inject JS files like the regular phantomjs implementation as proposed in issue #45. I've changed the parameter name to injectJs so it matches with the phantomjs implementation.
Usage:
conversion({
url: "http://example.com",
injectJs: [
__dirname + '/polyfill.js' // <-- include the full path to the script(s) to be injected
]
}, function(err, pdf) {
...
});
Unit tests are included for both phantom-server and dedicated-process implementations. Perhaps we could create a helper file to keep the strings in the test file and the file to be injected matched up.
This functionality allows you to inject JS files like the regular phantomjs implementation as proposed in issue #45. I've changed the parameter name to
injectJs
so it matches with the phantomjs implementation.Usage:
Unit tests are included for both phantom-server and dedicated-process implementations. Perhaps we could create a helper file to keep the strings in the test file and the file to be injected matched up.