Expand All Facebook Responses

Update for 2023+

This no longer works. This tool stopped working sometime early in 2023, and I will no longer be maintaining it. It kinda-sorta still works (better on old / legacy threads), and I’ll leave it up indefinitely. It has stopped working due to Facebook changes that, as a human, make no sense to me and have finally caused me to ignore Facebook (going on six months now).

Old introduction

I have written a JavaScript bookmarklet that expands all comments and replies in Facebook posts. This applies only to the full version of the Facebook website (e.g., www.facebook.com) and not to other web versions (e.g., m.facebook.com, touch.facebook.com) or to versions of the mobile app.

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 or update the bookmarklet, click here to bring up a page with the bookmarklet in it, along with some simple instructions.

Also see my Scroll All bookmarklet.

2021-02-17: I put this in GitHub.

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. This is how I use it, and I use it only on individual posts with usually many fewer than 100 comments and replies.

Others use this to expand multiple posts prior to archiving them. That wasn’t my original usage model and can hit Facebook limitations on how much it will retrieve (plus, it gets slower the longer it runs), but it’s still better than manually clicking.

To isolate a single post to a browser tab, ctrl-click on the post’s time stamp link, which is a permalink URL.

Warnings

If you need to 100% guarantee this bookmarklet does not click on something it shouldn’t, your only option is to avoid it altogether.

This is a bookmarklet and can only do what you can do, as you. There’s always the risk of clicking on something that wasn’t intended, especially if the code I write now decides to click on something that becomes something else in the future. This is what happened in 2020 with the translation links: they became indistinguishable from the like links (and the untranslate links, and the remove preview links). It became easier to remove the translation feature from the bookmarklet than claim to be able to figure out to not click the like link.

I would characterize the latest changes as follows: in some cases, where it used to be possible to select a list of links that should be clicked, now that list needs to be filtered by what should not be clicked. Unfortunately, that list of what not to click is probably incomplete. I found many cases to avoid, but others might find other cases.

This bookmarklet will not traipse down a multistep procedure, such as submitting a comment or sharing something. Check your Facebook activity log—you can likely undo any action taken. I myself would probably commit harakiri if I found out I had acted on a Trump post I was lurking on and could not undo it.

2021-01-20 notes

When I originally wrote this bookmarklet in 2014, I could hardly believe it kept working with no changes. I sat on it for about one year with no changes to Facebook before publishing it. Now in early 2021, Facebook changes every day in such a way that breaks this bookmarklet. The daily UI changes are gratuitous and serve no visual purpose.

The daily Facebook change involves an image ribbon and the CSS used to display an image from the ribbon. It all changes under the covers daily, yet there’s no visual change. I thought I’d be able to fix the problem by programmatically analyzing the CSS on-the-fly but no, both the CSS rule name and the CSS rule itself change (every day), for no actual purpose. There doesn’t seem to be a way to programmatically determine the CSS rule name from anything fixed. Plus, parsing CSS across browsers seems to have insurmountable security restrictions.

Up to this point, I managed to keep this completely independent of the display language, meaning you could choose any of the 112 languages supported by Facebook and this tool would work. I did this by keying only off the CSS and DOM structure.

This has changed now that Facebook changes CSS names and definitions daily. I’ve resorted—in only one case—to parsing display text. Of the possible 112 languages, I’ve added support for 34 or so. Maybe eventually I’ll link to a list of supported languages so it’s clearer. Part of the problem is that now, if Facebook changes the translation of the text I’m using, including fixing problems, it will break the bookmarklet.

The failure when a language is not supported is not terrible; under certain conditions, the bookmarklet won’t click a link that retrieves more replies. I think I’ve eliminated the problem with expand / collapse loops (using code), and only some threads won’t be fully expanded.

It only takes 5 – 10 minutes to add support for a language (not long). Facebook supports 112 languages (supporting them all would take days). I’m happy adding individual languages, but I plan to do that only if I hear of them (i.e., upon request).

2020-11-30 update

I made a difficult decision today to make a change based on Facebook’s incessant changing and breaking this tool (collapse/expand looping). The change is intended to prevent loops, but it is at the cost of an occasional (rare, I hope) incomplete expansion.

There will be just as much maintenance, except it will be to click on something that should be clicked on rather than to avoid clicking on something that shouldn’t be clicked on. When it breaks every few days, it will cause some (hopefully) rare expansions to be incomplete rather than to get stuck in infinite loops.

I’m also hoping to address the problem of leapfrogging, where certain locales are greater-than-one Facebook builds ahead of me, so they never benefit from the changes I make, as I’m always a few builds back.

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 responses being displayed. New log text goes to the top rather than the bottom.

The bookmarklet clicks on links to get more responses. It clicks and waits for the new content, which is recursively checked for new links. After all the responses are obtained, it clicks any and all See More links.

It finds links to click by querying on CSS style names and is thus cultural language independent and should work with Facebook set to display in any language, with the exception of:

Before expansion begins, comment filtering is checked and, if needed, changed to All comments. This is starting as an English-only feature; additional languages added upon request. Messing with comment filtering is optional (see bookmarklet settings).

Please don’t do this

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

  1. You probably aren’t really interested in that many throw-away comments.
  2. It gets slower and slower as more comments are pulled over, which I think is more of a browser thing than a Facebook thing.

If you want to stop the bookmarklet, hit ESC if ESC doesn’t conflict with what you are doing, or click the bookmarklet again. If you run it again, it will pick up where it left off (effectively, not literally).

Bookmarklet settings (new)

This section is new as of 2019-03-14.

Please be aware that modifying settings for this bookmarklet is weird and backwards, but bookmarklets are themselves a little weird. To modify the settings, you must run the bookmarklet from Facebook; the settings UI comes up at the end by pressing ‘s’ sometime during its run; changes you make are for next time, not this time, if that makes sense.

You can customize the bookmarklet from any Facebook page, but if you want to ensure that it finds nothing to expand, you can run it on a Facebook page with no posts, such as https://www.facebook.com/find-friends/browser/.

The UI settings will not persist across browser sessions if you are incognito/private or running Tor’s Firefox browser (see next section).

If you use this UI, you can no longer have multiple Expand All bookmarklets with different settings (see next section).

Customizing the bookmarklet (old)

This section is old as of 2019-03-14. I’m leaving it here in case their are fanatics who either use Facebook incognito/privately or use Tor’s Firefox browser.

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

When you edit the bookmark (Properties in Firefox), you will see near the very beginning todo=6. You can change the numerical value. With this value, you control four bits of instruction:

  • 1: not used anymore
  • 2: expand comments
  • 4: expand replies
  • 8: not used anymore
  • 16: do not ensure comment filter (if it exists) is set to All comments

In combination, there are 8 possible values. Some examples, starting with a value of 6:

  • Subtract 4 to not expand replies
  • Add 16 to not change any comment filters

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 (everything I tried did not work).

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.
  • The script doesn’t parse display text.
  • You can run the bookmarklet multiple times. 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 jsbeautifier.org. 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.

Troubleshooting

Make sure you are using the latest bookmarklet. Let me know what language you use Facebook in and which browser family you use.

If this bookmarklet used to work and stopped working, chances are Facebook has changed, and I need to change the bookmarklet. I might notice the breakage myself, but it probably won’t hurt to let me know about it. Changes I’ve made are listed here.

As we learned in 2018, Facebook changes can roll out over a period of a few months. I’m in Silicon Valley (Santa Clara, California, U.S.A.), and my guess is that I can be the last to see changes (and thus, problems), as Facebook seems to use less-trafficked areas as beta sites.

If you’ve never seen it work in a situation:

If it doesn’t work for a public Facebook post that you can reveal without a violation of your privacy, send me or post a comment here with the permalink URL in it, and I will look at it.

If it works except for some non-public posts, chances are I won’t have be able to observe what makes it special and therefore won’t be able to fix it. I might be able to reproduce a problem in my own private context, depending on having the problem adequately described.

  • Bear in mind that this just automates clicking that you would otherwise do. Manually click on what is not working, and assess the situation from there.
  • You can run this bookmark multiple times without penalty. Sometimes doing so can reveal a clue, especially interspersed with your own clicking.
  • I consider myself a regular Facebook user. If there’s something unusual or nonstandard about your situation, feel free to elaborate. For example, I have no idea how to create, see, or show a “hidden comment.”
  • Facebook has limitations. Please read the section titled “Please don’t do this.”
  • It often doesn’t matter how brilliant you are at capturing the problem (e.g., with screenshots). If I can’t reproduce the problem, I probably can’t fix it or test any fix now and in the future.


Posted

in

by

Comments

500 responses to “Expand All Facebook Responses”

  1. Anssen Avatar

    So recently, facebook just idiotically implemented this new feature that scrolls into a certain post in a timeline even if we were to follow the permalink to said post. In other words, permalink doesn’t show single post, but rather just show you where it is in a page’s timeline. Consequentially, using your bookmarklet will expand ALL POST ON THAT TIMELINE. And currently, there is no way to turn off this feature.

    Never change facebookdev.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      The problem I see is with those public pages that anybody can view or subscribe to. The permalink URL puts the post of interest at the top, and the page continues with the rest of the feed below; there’s no way to isolate the post.

      I think I’ve addressed this now. If the post of interest is found at the top, this bookmarklet only expands that post (and logs a message accordingly). Otherwise, it expands everything it comes across.

      1. Anssen Avatar

        Well, that’s terrific! You, Sir, is a hero!

      2. Anssen Avatar
        Anssen

        Your fix with page post is great, but it’s still imperfect since I found another problem. Like you’ve said, permalink on pages will not isolate the post but rather showing said post on top of the said page’s timeline. But again, if said page has a post pinned, then permalinked post will be shown second.

  2. Nob Gatt Avatar
    Nob Gatt

    You’re my Hero sir for saving my time.
    There’s another facebook comments that can’t be loaded by this script.
    There is Facebook Comments on Blog or Website.
    Like on this site sir.
    http://www.jagatreview.com/2016/06/performance-test-amd-radeon-rx-480-crossfire/

    Thanks

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Sorry — the bookmarklet only applies to the full http://www.facebook.com website.

  3. Leonardo Avatar

    My girlfriend and I use private Facebook notes to communicate, so they generally accrue thousands of comments from our back-and-forth. I want to save these, because I’ll be killing my FB account.

    One note had 21K comments and SEVEN thousand “See More” links.

    Facebook’s “download your account” does not dump notes, so I did a bunch of searching, looked into imacros/greasemonkey/etc. Finally found bookmarklets and one that worked marginally ok, and then this post.

    TL;DR: THANK YOU.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Keep in mind that the bookmarket can time out. (Also, I have found that Facebook simply stops delivering comments after a lot.) You can run the bookmarklet multiple times without penalty to check for content that didn’t get expanded for whatever reason. (Well, I will admit I’ve never tested beyond a few hundred comments.)

  4. Dane Eric; Gross (Computer Dynamics) Avatar
    Dane Eric; Gross (Computer Dynamics)

    I am SO glad that someone not only thought of this but also has done it! Thank you so very much for this script, brilliant work! … I want to mention a couple of things here that I do in order to see someone’s whole Facebook page and save a COMPLETE copy … 1. I go to the Facebook page I want; 2. I allow popups from Facebook (on Firefox) so that this bookmarklet works 3. I use Flashblock Firefox add-on in order to block videos on the page from all auto-loading at the same time 4. I close any other tabs or any other thing running, as this can get pretty resource-intensive! 5. I then press down the PgDn(Page Down) key on the keyboard, then stick a penny into the keyboard on the bottom of the PgDn key between the key and the keyboard housing (only works with traditional PC desktop type keyboards, there may be another way with other devices) to hold down the PgDn key … that will keep the page scrolling on down until you have reached the bottom. … THEN DON’T FORGET TO REMOVE THE PENNY! 6. Click the “Expand All” bookmarklet in your bookmark toolbar. 7. Watch and wait as this amazing bookmarklet expands everything!

  5. kucimayong Avatar
    kucimayong

    Hey, this is great, however do you have one that works with the mobile version of facebook (m.facebook.com) ?

    The reason I am asking this is because sometimes I like to archive a thread and I usually archive the mobile version on my desktop.

    Btw, Thank you for your great bookmarklet!

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      There’s no mobile version. I never even thought of loading the mobile version on a desktop. Interesting.

  6. Jake Avatar
    Jake

    Do you have a script to auto-click invite buttons in a post likes list?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      No, but that’s an interesting idea.

  7. rudolph Avatar
    rudolph

    Can you please make this also for youtube comments ?

  8. Kevin Rietmann Avatar
    Kevin Rietmann

    Awesome work, I was futzing around with macros trying to achieve the same end, with little success. Please keep at it if the code changes, I’m sure I’m not alone in being willing to support your work. I absolutely despise the whole click to expand comments bit from any website and am always trying to find ways around them. Slashdot was always great for that, 500 comments loaded at a time, you’d have everything up in short order. Reddit is terrible. I found a Tampermonkey script to work with Discus but it broke. I bet someone’s done something similar to yours for YouTube.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Maybe I will look into using SourceForge one of these days.

      From a design standpoint, my theory has always been: optimize to work with a few hundred items, but acknowledge there is a threshold where paging/clicking-on-demand of some sort is needed, but it should be unlikely you would ever use it. If you are using it, then the UI is broken.

      If you force the user to click-on-demand to see 2, 10, or even 100 items, then the UI is broken. “See More” all over the place just adds insult to injury.

      What if there are 100,000 items? Okay, chances are you don’t want to see them all, but the UI should make it clear that they exist. At that point, what you need is a good search interface, which Facebook does not have; the language is there, but it just doesn’t work. Once again, the emperor has no clothes.

  9. Steve Avatar
    Steve

    Mine stops at about 500 on a post that has over 10K comments. Any suggestions?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      No. All I can do is corroborate that I’ve seen Facebook stop delivering comments after a certain point, where that point is different for different posts.

  10. Frances Cherman Avatar
    Frances Cherman

    Works beautifully. Thank you!

  11. Paco Avatar
    Paco

    Brilliant. I needed this so I can save and print to PDF a thread on fb I started in case the company I complained to takes it down. I especially appreciate your concern for people like me who suspect anything I download from the net. You give a complete explanation of what it does and how to check that. BTW F12 doesn’t work on Chrome 49 but ‘alt-cmd-j’ does. Also no beautifier simplifies the code. 🙁

  12. Par Lindroos Avatar
    Par Lindroos

    Great script, I have multiple pages with thousands of comments, and this saves me alot of time if I need to do a print screen on all of them.

    Is it possible to also show the hidden comments, the ones with 3 grey dots? Not show like make them visible for everybody, but so that is possible to get them in the print screen.

    Thanks again.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I’ve never seen a hidden comment and don’t know how they work. I have found a page that talks about them, yet I am unable to create any to see how they work (perhaps because Facebook considers me a safe commenter on my own posts).

      All this bookmarklet does is automate the clicking that you could be doing. It can’t do anything you can’t do yourself, since it’s just acting as you. If you still think there’s something that can be automated, can you provide a link to a public post containing a hidden comment, so I can see it?

  13. SoCRaT Avatar

    Thanks for the great code!

    However, I’m facing a problem with facebook page.
    I use the Google Chrome AutoScroll extension to scroll to the end of the page, then I run the bookmarklet (Chrome Version 53.0.2785.143 (64-bit) on Linux Mint 18). It starts very well and detects about 850 items. It works till it reaches around 200, then suddenly I find it opened a link to one of the notes of the page and browsed to it, so it destroys everything.

    Do you have any idea why that might be happening?

    Thanks again.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Can you provide a link to a public post with this problem? I looked up how to work with Facebook Notes, and created one, but it does not cause a problem. (Notes should be ignored by this bookmarklet.)

      Since this bookmarklet clicks on Facebook links, if there’s a Facebook link that navigates away from Facebook, yes, in theory that could cause a problem. But it would help if I could see an example of that.

  14. bluenote Avatar
    bluenote

    Hi Jens

    Thanks for this. I wonder if you would consider keying this on the mobile (m.facebook.com) or even (mbasic.facebook.com) I use these to be able to then print out a sane view of the post and comments. (mainly m.facebook.com)

    Either way thanks for what you’ve done here

  15. uhclem Avatar
    uhclem

    You are a god! Thank you!

  16. Nadleeh Avatar
    Nadleeh

    This is the best! Works great on Safari 10.0.1 (on macOS 10.12.1) btw.

  17. Angelo V. Avatar

    Really great! I’m using in this moment your script to try to find a comment on a famous actor’s page.
    Now i’m at 7500 comment of 19,619, script still working, sometime using ctrl+f to search the name of commenter.

    I think can be useful add an option to look for a string than pausing/stopping the scritpt when found – Maybe I can try to change the script by myself but I’m not really a good programmer 🙂

    Chrome task manager tells me I’m using more than 1,2 GB of ram for that page but a little data from Internet, taking 40% of CPU. Page is now really slow but the script is still working
    Chrome, windows 10, core i5, 8GBRAM

    Ops! While writing the text above the page crashed, out of ram! Thats all 🙂

  18. molebox Avatar
    molebox

    Hi. Thanks for this great tool! Early was all ok, but i have problem now:
    The script expand “View more replies” and to end hided a some threads:
    click (1 left): Hide 16 Replies
    click (2 left): Hide 33 Replies
    Maybe it from updated Chrome from 48 to 54?
    p.s. public link – https://www.facebook.com/yuri.biriukov/posts/1700509770217833?pnref=story#

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Thank you for pointing this out and for including the URL. I believe I have fixed the problem (and a few others). The problems are caused by Facebook changing, not the browser. You can update the bookmarklet at the link found at the start of this article.

      1. molebox Avatar
        molebox

        Wow, it’s was fast!) I tested the fixed script with two different post – its work! Thank you)

  19. Steven Avatar
    Steven

    Wow! Great work! A big thank you for making this and an even bigger one for updating it.

  20. heya Avatar
    heya

    wow, i am impressed

  21. Ira Avatar
    Ira

    Fantastic, thanks. It’s stupid that fb doesn’t have this functionality built-in.

  22. failfake3 Avatar
    failfake3

    Flawless!! thank you so much!

  23. Pablo Stafforini Avatar

    Thanks so much for creating this.

  24. Cheburashka Avatar
    Cheburashka

    Super!!!

  25. imminiman Avatar
    imminiman

    Nice job! Thank you 🙂

  26. LafinJack Avatar
    LafinJack

    Hello, do you accept donations? I had this from a while back and noticed my version didn’t do “x comments” links – I searched for a replacement and instead found the updated version. 🙂

  27. Ahmed Mohsen Avatar

    Thank you very very much , but I have a profile that content thousands of comments on every post , Are there any solution for make all comments appear ?
    https://www.facebook.com/mo777sn

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      All your base posts (even ignoring comments) are so long, Facebook will only display them in separate tabs (in English, the link that indicates this is ‘Continue Reading’). In terms of automatically expanding everything, this can’t do it; browser security prevents this from operating across different tabs.

  28. Tony Gibson Avatar

    Dear author,
    this script works great normally, but when come to this scenario, it’s expected to make a bit version change to support better, the scenario as beneath:
    recently a period of time later after joined a facebook group, i’d like to start read the whole threads/posts within it. so i scroll down until the creation of the group;
    now we can imagine that it’s quite a bit large for the web-page, since it’s already loaded the group’s whole surface content, it’s around 40MB size, i’m using windows7 64 bit, with 8GB RAM; i found that the script working from up to down, since it will load more and more hidden contents, so we can imagine the web-page is hardly load any more, which causing the down side of the web-page can’t be handled via this script. and after tried at least 5 times, the reality is exactly the same as the imagination.
    so the expectation here is:
    can the script modified to working from down to up(reversely as currently)?
    so that in this kind of scenario, we can expand the whole group’s hidden contents via 2 times, 1st via the current script, and the 2nd via the expected version, apparently, this method still needs some manual supervision to let these 2 times meet in the middle, or overlap a bit to ensure the overall object be met.
    Thanks for the consideration.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      This script just automates clicking. If it runs out of memory or slows down to the point of stopping or simply stops responding (and this is my experience with Facebook), it’s the same whether you click manually or use this script.

      1. Tony Gibson Avatar

        yup, i know it’s the same whether i click manually or use this script to cause the out of memory or just stop nearly;

        and that’s exactly the reason i think the reverse handling can to some extent fix this issue, it’s just a game of try to reach the middle point between up side & down side, just as ctrl+f in chrome to search, f3 means from up to down, and shift+f3 means from down to up(just take a reverse);

        so i think maybe can take it as the example to inspire something for the script.

  29. Bob Avatar

    A Rookie here so I please don’t tech talk over my head. I have a Facebook post with over 60k shares. I normally thank people that share my post but FB bogs down when I scroll down with this many. I was thinking if I could close all the comments I could scroll to the bottom one and work my way up. Does that make sense? Will this product do that? Thanks – Bob

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      This won’t help with that.

  30. mgabo Avatar
    mgabo

    You are my hero! Thank you for saving me countless hours of work.

    a grateful social scientist

Leave a Reply to Jens-Ingo Farley Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.