This script would be convenient in a plugin to show all comments for a post
// for plugin: display whole reddit post & responses without site JS enabled
d = document.getElementsByTagName('div');
console.log("total DIVs: " + d.length);
var firstPost = null;
for(var xint = 0, len = d.length;xint < len;xint++){
if(d[xint].getAttribute('data-scroller-first') != null){
console.log('found one');
console.log(d[xint]);
firstPost = d[xint];
break;
}
}
firstPost.style.maxHeight = "100%";
firstPost.parentElement.style.maxHeight = "100%";
firstPost.parentElement.parentElement.style.maxHeight = "100%"; // show all posts
// but white fade will still be over bottom-most post
// remove ads under topic post
postRoot = firstPost.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
postRoot.removeChild(postRoot.children[2]);
//work thus far on expanding reddit no extra scripts
/*
top most part of post
.parentElement.children[2]
that is who we want to delete (ads, irrelevant misc stuff)
[0] is tabindex
[1] is post
[2] is ads below with videos that autoplay when scrolled to (ew!)
*/
No comments:
Post a Comment