From f147f634277864cd6cfb8d5184c6392e044453c6 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 20 Jan 2018 17:02:39 +0100 Subject: behavior: Scroll all DOM elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One example is Twitter, which uses a popover div for individual tweets. Scrolling the page won’t scroll that div’s content, which is required to load more replies. --- crocoite/data/scroll.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crocoite/data/scroll.js b/crocoite/data/scroll.js index 0d1a4a7..13e856d 100644 --- a/crocoite/data/scroll.js +++ b/crocoite/data/scroll.js @@ -7,6 +7,12 @@ function scroll (event) { return false; } else { window.scrollBy (0, window.innerHeight/2); + document.querySelectorAll ('*').forEach ( + function (d) { + if (d.clientHeight < d.scrollHeight) { + d.scrollBy (0, d.clientHeight/2); + } + }); return true; } } -- cgit v1.2.3