Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Twitter timeline scroll
// Scroll Twitter home (worked for profiles too before a Twitter update)
/*var target_tweet = document.getElementById("stream-items-id");
var target_fail = document.getElementsByClassName("stream-fail-container")[0];*/
// Scroll Twitter profiles
var target_tweet = document.getElementsByClassName("GridTimeline-items")[0];
var target_fail = document.getElementsByClassName("GridTimeline-failure")[0];
var height = target_tweet.scrollHeight;
var observer = new MutationObserver(function(mutations) {
for (var i = 0; mutations[i]; i++)
window.scrollBy(0, height);
var config = { attributes: true, childList: true, characterData: true }
observer.observe(target_tweet, config);
observer.observe(target_fail, config);
window.scrollBy(0, height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment