lib/capturejs.js
function captureImage(page) {
        if (DEBUG && !page.phantom) inspectArgs("captureImage: ", page);

        if (option.selector) {
            let getElement = [ "function () {",
                , "document.body.bgColor = 'white';"
                , `var elem = document.querySelector('${option.selector}');`
                , "return (elem !== null) ? elem.getBoundingClientRect() : null; };"
            ].join("");

            return page.evaluateJavaScript(getElement);
        }
    }
function captureImage(page) {
        if (DEBUG && !page.phantom) inspectArgs("captureImage: ", page);

        if (option.selector) {
            let getElement = [ "function () {",
                , "document.body.bgColor = 'white';"
                , `var elem = document.querySelector('${option.selector}');`
                , "return (elem !== null) ? elem.getBoundingClientRect() : null; };"
            ].join("");

            return page.evaluateJavaScript(getElement);
        }
    }
function captureImage ( page ) { if ( DEBUG && ! page . phantom ) inspectArgs ( "captureImage: " , page ) ; if ( option . selector ) { let getElement = [ "function () {" , , "document.body.bgColor = 'white';" , ` ${ option . selector } ` , "return (elem !== null) ? elem.getBoundingClientRect() : null; };" ] . join ( "" ) ; return page . evaluateJavaScript ( getElement ) ; } }
Capture the specified image.
Capture the specified image .