Script to jump to unread comments in a post

kalebo
Tue, 22 May 2018 05:27:23 +0000

Okay, so I got tired of scrolling through some of the long comment chains looking for that flash of orange that indicates a new post so I slapped together this solution. It's not pretty nor frictionless to use, but it's less annoying for me than scrolling for days just to find the new comments.

Basic usage is to open the javascript console or scratch pad (e.g., Shift+F4 in Firefox) in your browser, paste in the following line from the code block and run it. It scrolls to the first unread comment and marks it as read; on subsequent runs it will do the same thing for the next unread comment and so on. You will need to enable new comment tracking in your Tildes preferences as well if you haven't done so yet.

{var comment = document.getElementsByClassName("is-comment-new")[0]; if (comment != null) {comment.scrollIntoView(); comment.className = "comment"}}

I had hoped that I could make it into a bookmarklet but unfortunately CSP nixes that option. If anyone else knows of a better way to do this let me know.

Comments URL: https://tildes.net/~tildes/nq/script_to_jump_to_unread_comments_in_a_post

Votes: 10

Comments: 5