mirror of
https://github.com/encounter/phantomjs.git
synced 2026-03-30 11:35:11 -07:00
7f9e03ffad
This is explained in http://code.google.com/p/phantomjs/issues/detail?id=16: 'arguments' is reserved word. Reported by: Nicolas Ferrero.
17 lines
455 B
JavaScript
17 lines
455 B
JavaScript
if (phantom.state.length === 0) {
|
|
if (phantom.args.length !== 2) {
|
|
console.log('Usage: rasterize.js URL filename');
|
|
phantom.exit();
|
|
} else {
|
|
var address = phantom.args[0];
|
|
phantom.state = 'rasterize';
|
|
phantom.viewportSize = { width: 600, height: 600 };
|
|
phantom.open(address);
|
|
}
|
|
} else {
|
|
var output = phantom.args[1];
|
|
phantom.sleep(200);
|
|
phantom.render(output);
|
|
phantom.exit();
|
|
}
|