-
-
Save svirmi/963f7a34617c069649ff7447519547e7 to your computer and use it in GitHub Desktop.
Automatic scroll to bottom of page in twitter and facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name AutoScroll | |
| // @namespace https://gist.github.com/eykanal/a0b30e035d8c15995deeffec6ab21866 | |
| // @version 0.1 | |
| // @description Automatically scroll to the bottom of the page | |
| // @author Eliezer Kanal | |
| // @match https://www.facebook.com/search/str/* | |
| // @match https://twitter.com/search* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| var lastScrollHeight = 0; | |
| function autoScroll() { | |
| var sh = document.documentElement.scrollHeight; | |
| if (sh != lastScrollHeight) { | |
| lastScrollHeight = sh; | |
| document.documentElement.scrollTop = sh; | |
| } | |
| } | |
| window.setInterval(autoScroll, 100); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment