From e5f9df2a6c31c644382966ffff8ff6ada9ca2b11 Mon Sep 17 00:00:00 2001 From: andreilupu Date: Wed, 19 Oct 2016 00:28:03 +0300 Subject: [PATCH] Let the capture height be 100% by default When there is no height parameter set allow the full height instead of the 1500 default For BBC-News/wraith#318 --- lib/wraith/javascript/phantom.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/wraith/javascript/phantom.js b/lib/wraith/javascript/phantom.js index 78f1a89b..34e11bcc 100644 --- a/lib/wraith/javascript/phantom.js +++ b/lib/wraith/javascript/phantom.js @@ -61,6 +61,13 @@ page.open(url, function(status) { phantom.exit(); } + var height = page.evaluate(function() { return document.body.offsetHeight }), + width = page.evaluate(function() { return document.body.offsetWidth }); + + currentDimensions.viewportHeight = height; + + page.viewportSize = { height:height, width:width } + setTimeout(checkStatusOfAssets, waitTime); });