Traverse Facebook Comments by Time

I have written a bookmarklet that facilitates traversing all Facebook comments for a given post in time order. This applies to the full version of the Facebook website.

To install the bookmarklet, click here to bring up a page with the bookmarklet in it, along with some simple instructions.

Also see my Expand All bookmarklet.

Things you must know

To use this bookmarklet, you must have a single post isolated to a browser tab or window. To do this, ctrl-click on the timestamp of the post you are interested in.

Next, you most likely will need to run my “Expand All” bookmarklet to expand all comments and replies. The only comments linked are the comments you can see at the time. By the way, this links comments and replies.

Finally, when you run this “Link Comments” bookmarklet, it will jump to and highlight the last comment made on the post. (If you don’t see a highlighted comment, something went wrong.) To traverse, use the keyboard:

  • Ctrl+up: jump to previous comment (if any).
  • Ctrl+down: jump to next comment (if any).
  • Ctrl+home: jump to first comment.
  • Ctrl+end: jump to last comment.
  • ESC: detach this bookmarklet from the page.
  • Mouse click on a comment: highlight and make that comment the current comment.
    • Ctrl+click: shade all comments newer than the one clicked.

It’s not recommended, but you can also traverse the comments using the mouse by clicking on the older/newer links generated by the bookmarklet.

What does this [not] help with?

This solves a need I had; maybe others will find it useful. Let me describe an example scenario I wrote this for:

  • I care about the post, who comments, and what they say. (Not worthless comment bait, or something posted by a public figure with tons of throw-away comments I don’t care about.)
  • I’ve been following the post but am losing track of all the comment threads emerging like tentacles. I don’t want to read from the beginning each time; I just want to see what’s new.

Let me emphasize: if you are freshly coming to a post with many tentacles, you’ll want to read the post in branch-sequence (i.e., how Facebook presents it to you), not time-sequence. It’s only when you’ve watched comments unfold that time-sequence makes any sense, and that’s what this bookmarklet is intended to help with.

Expand All Facebook Comments

I have written a bookmarklet that expands all comments and replies in Facebook posts. This applies to the full version of the Facebook website. Bookmarklets are not the prettiest or best-understood things in the world, but I’m making it available in case people want to use it:

To install the bookmarklet, click here to bring up a page with the bookmarklet in it, along with some simple instructions.

Also see my Link Comments bookmarklet.

What does this help with?

This expands Facebook posts so that you can see/read all comments and replies from top to bottom without clicking.

To isolate a single post to a browser tab, ctrl-click on the post’s time stamp, which is a permalink URL. Then, run the bookmarklet on the isolated post by clicking on the bookmark. Or, run the bookmarklet on multiple posts (e.g., search results in a private group) and it will expand all posts it finds.

2016-07-09 update. The permalink URL to a public page (for celebrities, businesses, etc.) stopped isolating the post; now the whole news feed is displayed with the post of interest at the top. If a page like this is encountered, this bookmarklet only expands the permalinked post. Facebook has changed how they do this at least twice now; I’m trying to keep up.

Also, Facebook sometimes goes into theater mode (one post rendered on top of the news feed). If this happens, hit ESC to go back to the main feed before expanding.

Browser support

I mostly use the Google Chrome browser on a Windows PC, and I don’t use mobile devices. Among the main browsers, bookmarks in Chrome were the easiest and most intuitive to use.

Mozilla Firefox also works, though getting the bookmark bar to show up is slightly more cumbersome.

I tried Microsoft Edge once just to make sure things seem to work there (which they did). Bookmarklets in Edge was a complete hack through the file system; really, not supported.

Details of what this does

Output is logged to both a temporary visual text area and to the browser console. The text area goes away when it’s done, so if you want to see a record of what happened after-the-fact, you’ll need to hit F12 and open the browser console. When the script completes, it logs a numerical total of all comments and replies being displayed.

The bookmarklet clicks on the following links, sequentially. That is, it clicks and waits for the new content, which is recursively checked for new links:

  • View more comments
  • View previous replies
  • View more replies
  • View [x] more replies
  • [x] replies
  • [user] replied

After all the comments and replies are obtained, it clicks any and all See More and See Translation links.

It finds links to click by querying on CSS style names and is thus language independent, but see the Warnings ahead.

Please don’t do this

This isn’t recommended on posts that have many thousands of comments:

  • First, you probably aren’t really interested in posts with that many comments.
  • Second, I have found that Facebook stops delivering comments after a certain point; you can click the View more comments link, and nothing happens (visually, anyway). This bookmarklet bumps into the same limitation: it will iteratively click the View more comments link and eventually time out as nothing happens.

That said, you still might want to try this, if you are searching for a specific person’s comment or reply among many. Just be aware that eventually Facebook stops delivering comments.

If you want to stop the bookmarklet, hit ESC.

Customizing the bookmarklet

You can customize what the bookmarklet does. You can create multiple bookmarklets, each with a different customization.

As you’re creating or editing the bookmarklet, you will see near the very beginning todo=15. You can change the single-digit numerical value. With this number, you control four bits of instruction:

  • 1: expand the post itself (open Continue Reading links)
  • 2: expand comments
  • 4: expand replies
  • 8: click on any translation links

In combination, there are 16 possible values: 0 through 15. Some examples, starting with a value of 15:

  • Subtract 4 to not expand replies
  • Subtract 8 to remove the translation step

Note that I only regularly use (hence, test) the default value.

Why did I do this?

I looked around to see if someone else had done something like this already, and of course I might have missed something, but it became apparent to me that it would be easier to do this myself than to keep looking for something that actually worked.

Warnings and notes

  • This works today based on how Facebook is rendered in HTML today. It might break tomorrow, and I might not be able to fix it.
  • Though the script doesn’t outright parse display text, it attempts to parse integers as a way to avoid clicking Hide links. I have tried about 10 different languages, all of which worked (I think). Please let me know if you find a problematic language, such as where the script shows and hides replies endlessly.
  • You can run the bookmarklet multiple times; it’s harmless. Sometimes it helps to do this if Facebook is slow and timeouts result in an incomplete expansion.
  • If you want to see the bookmarklet’s JavaScript in a readable format, copy-and-paste it into a beautifier such as In fact, if you know JavaScript, you might want to do this to boost your confidence that I am not trying to hack you with some malicious script.