Skip to content

Instantly share code, notes, and snippets.

@gfranko
Created May 30, 2014 21:45

Revisions

  1. gfranko created this gist May 30, 2014.
    10 changes: 10 additions & 0 deletions webshot.phantom.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    // Handle customCSS option
    if (typeof options.customCSS === 'string') {
    page.evaluate(function(customCSS) {
    var style = document.createElement('style');
    var text = document.createTextNode(customCSS);
    style.setAttribute('type', 'text/css');
    style.appendChild(text);
    document.head.insertBefore(style, document.head.firstChild);
    }, options.customCSS);
    }