summaryrefslogtreecommitdiff
path: root/crocoite/data/click.js
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-11-24 12:57:03 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-11-24 13:03:29 +0100
commit070bf5b2196955e6447869c23147422b4c64ffd6 (patch)
tree2c60c28c7f29dee203ca1ffbd8e200d49a83a58c /crocoite/data/click.js
parent38441dafb7f5dd6e558db0b4dbc1a4f1a90df162 (diff)
downloadcrocoite-070bf5b2196955e6447869c23147422b4c64ffd6.tar.gz
crocoite-070bf5b2196955e6447869c23147422b4c64ffd6.tar.bz2
crocoite-070bf5b2196955e6447869c23147422b4c64ffd6.zip
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.
Diffstat (limited to 'crocoite/data/click.js')
-rw-r--r--crocoite/data/click.js9
1 files changed, 7 insertions, 2 deletions
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};
+}())