'load more comments' in reddit.com remains at "loading.." when clicked via my userscript
Reddit uses retarded inline js, so you can't invoke it from a sandboxed userscript by default.
- Replace
// @grant none
with// @grant unsafeWindow
var element = unsafeWindow.document.getElementsByClassName('morecomments');
Thank you very much for the quick answer!
'load more comments' in reddit.com remains at "loading.." when clicked via my userscript
I'm trying to improve my userscript Reddit Infinite Scrolling (jScroll)
so that (in reddit posts that have many comments) (for example this post),
when user user has scrolled to the bottom,
to automatically click the last button(element) "load more comments"
and therefore to have infinite scrolling in comments too.
So, I've made this code (based on this) :
The alert
bottom!
works alright, but the last button(element) "load more comments" of the page, doesn't load more comments, but stays at 'loading...'.Note: I've even tried the commmented out line
$(window).unbind('scroll');
but it didn't make any difference.
On the other hand, in Firefox Console,
document.getElementsByClassName('morecomments')[77].firstChild.click();
works ok.
Could you please help me with this?