From f08ecd4ddc55f4a6a17d66590ba57e770eb6f499 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 31 Aug 2018 02:35:11 -0400 Subject: Handle scrolling on Reddit redesign --- content_scripts/scroller.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'content_scripts') diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 7202c682..b134dbe1 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -319,6 +319,15 @@ if DomUtils.isTopFrame() and window.location.host == "twitter.com" activatedElement = element ? getScrollingElement() func arguments... +if DomUtils.isTopFrame() and window.location.host in ["reddit.com", "new.reddit.com"] + for method in ["scrollTo", "scrollBy"] + do -> + func = Scroller[method] + Scroller[method] = -> + element = document.getElementById "overlayScrollContainer" + activatedElement = element ? getScrollingElement() + func arguments... + root = exports ? (window.root ?= {}) root.Scroller = Scroller extend window, root unless exports? -- cgit v1.2.3