From 070bf5b2196955e6447869c23147422b4c64ffd6 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 24 Nov 2018 12:57:03 +0100 Subject: behavior: Fix scrolling - Introduce stop() method callable from Python. Looks like the old method (global variable) was not working (any more?). This is much better anyway. - Restore state of scrolled elements (not window). Fixes weird screenshots of twitter.com. --- crocoite/data/click.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crocoite/data/click.js') diff --git a/crocoite/data/click.js b/crocoite/data/click.js index 88c8f24..b098810 100644 --- a/crocoite/data/click.js +++ b/crocoite/data/click.js @@ -165,5 +165,10 @@ function discover () { } /* XXX: can we use a mutation observer instead? */ -window.setInterval (discover, discoverInterval); -}()); +let interval = window.setInterval (discover, discoverInterval); + +function stop() { + window.clearInterval (interval); +} +return {'stop': stop}; +}()) -- cgit v1.2.3