aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorMarco Costa2018-08-31 02:35:11 -0400
committerMarco Costa2018-08-31 02:35:11 -0400
commitf08ecd4ddc55f4a6a17d66590ba57e770eb6f499 (patch)
treebd9d3ebf60c54da84b5655ac5c6e5067ce55d1f8 /content_scripts
parent12ab37b8bc78996443d142d8ef28ee47f725716c (diff)
downloadvimium-f08ecd4ddc55f4a6a17d66590ba57e770eb6f499.tar.bz2
Handle scrolling on Reddit redesign
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/scroller.coffee9
1 files changed, 9 insertions, 0 deletions
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?