intel-screenbot

An Ingress Intel Map Bot for Hangoutsbot
git clone git://archive.git.mtrnord.blog/MTRNord/intel-screenbot.git
Log | Files | Refs | README | LICENSE

commit a26881e54a05a38a86ad31f55b15056eafcfbc14
parent 5e6af8b9516ba01c86b165d1ff2107435cadc686
Author: Marcel <MTRNord@users.noreply.github.com>
Date:   Sat, 31 Dec 2016 23:01:53 +0100

Dom modifications could break it
Diffstat:
Mscreencap.js | 47+++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/screencap.js b/screencap.js @@ -237,35 +237,38 @@ function portalinfoScreen(){ var clipRect = page.evaluate(function(){ return document.querySelector('#sidebar').getBoundingClientRect(); }); + setTimeout(function() { + var elementHeight = page.evaluate(function(){ + return $("#sidebar").height(); + }); - var elementHeight = page.evaluate(function(){ - return document.querySelector('#sidebar').offsetHeight; - }); - - page.clipRect = { - top: clipRect.top, - left: clipRect.left, - width: clipRect.width, - height: elementHeight - } - setTimeout(function() {s(filepath)}, "1000"); + page.clipRect = { + top: clipRect.top, + left: clipRect.left, + width: clipRect.width, + height: elementHeight + } + setTimeout(function() {s(filepath)}, "1000"); + }, "2000"); }, error: function () { var clipRect = page.evaluate(function(){ return document.querySelector('#sidebar').getBoundingClientRect(); }); - var elementHeight = page.evaluate(function(){ - return document.querySelector('#sidebar').offsetHeight; - }); - - page.clipRect = { - top: clipRect.top, - left: clipRect.left, - width: clipRect.width, - height: elementHeight - } - setTimeout(function() {s(filepath)}, "1000"); + setTimeout(function() { + var elementHeight = page.evaluate(function(){ + return $("#sidebar").height(); + }); + + page.clipRect = { + top: clipRect.top, + left: clipRect.left, + width: clipRect.width, + height: elementHeight + } + setTimeout(function() {s(filepath)}, "1000"); + }, "2000"); } }); }, "1000");