commit 9b230aa94806385d02682d7ad7f2c65d2c2d517c parent 9fd10e6a7ed32ad30d8b3e189e4dd1017bce60f8 Author: Marcel <MTRNord@users.noreply.github.com> Date: Tue, 15 Nov 2016 21:00:36 +0100 Wait until site shows that Diffstat:
| M | screencap_iitc.js | | | 16 | +++++++++++++++- |
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/screencap_iitc.js b/screencap_iitc.js @@ -426,7 +426,21 @@ function hideDebris() { function prepare(widthz, heightz) { window.setTimeout(function() { page.evaluate(function(w, h) { - $("span:contains(' Google Roads')").prev().click(); + waitFor({ + timeout: 240000, + check: function () { + return page.evaluate(function() { + if (document.querySelector('.leaflet-control-layers-base')) { + return true; + }else{ + return false; + } + }); + }, + success: function () { + $("span:contains('Google Roads')").prev().click(); + } + }); var water = document.createElement('p'); water.id='viewport-ice'; water.style.position = 'absolute';