Skip to content

PhantomJS Static Script

sbehrens edited this page Dec 4, 2014 · 1 revision

Located within the sketch/assets/static.js file, is the PhantomJS script that provides a screenshot for a provided HTML file.

Customizing the PhantomJS Static script

There are four key areas which may warrant customization and they are enumerated below:

var defaultOpts = {
    ajaxTimeout: 400,
    maxTimeout: 800
};

ajaxTimeout - Increase this value if Ajax heavy web applications are not fully loaded when screenshots are created.

maxTimeout - Increase this value if resource heavy web applications are not fully loaded when screenshots are created.

You can also make changes to the default size of the requests (which is 1280,800):

var opts = {
    width: 1200,
    height: 800
};