From 588820d2fee2d64b6495a76bd51edebd26bc1822 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 1 May 2022 15:51:56 +0200 Subject: [PATCH] tweaks --- changedetectionio/content_fetcher.py | 3 ++- changedetectionio/static/js/visual-selector.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index 36b96960..fdcc7d97 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -249,7 +249,8 @@ class html_webdriver(Fetcher): self.headers = {} def screenshot(self): - return self.driver.get_screenshot_as_png() + screenshot = self.driver.get_screenshot_as_png() + return screenshot # Does the connection to the webdriver work? run a test connection. def is_ready(self): diff --git a/changedetectionio/static/js/visual-selector.js b/changedetectionio/static/js/visual-selector.js index 27c376d0..c314dc8f 100644 --- a/changedetectionio/static/js/visual-selector.js +++ b/changedetectionio/static/js/visual-selector.js @@ -14,6 +14,8 @@ var y_scale; var selector_image = document.getElementById("selector-background"); var selector_image_rect; var vh; +var selector_data; + function fetch_data() { // Image is ready @@ -24,7 +26,8 @@ function fetch_data() { context: document.body }).done(function (data) { $('.fetching-update-notice').html("Rendering.."); - reflow_selector(data); + selector_data = data; + reflow_selector(); $('.fetching-update-notice').fadeOut(); }); }; @@ -42,6 +45,7 @@ $(window).resize(function() { $('#visualselector-tab').bind('click', function (e) { set_scale(); + reflow_selector(); }); @@ -62,7 +66,7 @@ function set_scale() { } -function reflow_selector(selector_data) { +function reflow_selector() { var selector_currnt_xpath_text=$("#selector-current-xpath span");