forked from ariya/phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Tips and Tricks
ariya edited this page Jan 5, 2013
·
1 revision
PhantomJS does not set the background color of the web page at all, it is left to the page to decide its background color. If the page does not set anything, then it remains transparent.
To force a certain color for the web page background, use the following code:
page.evaluate(function() {
document.body.bgColor = 'white';
});
Make sure this is executed before caling render() function of the web page.
This is possible using the Filesystem API.
An example to write directly to standard output:
var fs = require("fs");
fs.write("/dev/stdout", "Hello, world!", "w");
Caveat: it may not work on Windows.