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. Gaz Avatar
    Gaz

    Hoping for an update – it is now broken as they added a comment category “hidden by this page” making Relevant comments be in the place of all comments. Anyone know the value that needs editing to change it to position 4 in the drop down?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      It sounds like perhaps you are talking about a group you are the admin of? I am not the admin of a group and do not see this problem.

      I’d kind of like to verify this before I go down the rabbit hole of creating a group and trying harder to reproduce the problem, because I suspect it’s more than being the admin but also an admin setting (that I’ll need to find).

  2. Mauricio Valencia Avatar
    Mauricio Valencia

    Oh my goodness, amazing job! You’re saving people a ton of time and energy. Thank you

  3. Konstantin Avatar
    Konstantin

    It just openes a blank page

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      What does “it” refer to?

  4. Rakin Avatar
    Rakin

    Does anyone know how to expand the posts only and not comments and replies? I tried removing some functions but then only 344 posts get expanded and rest are skipped

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Could you briefly explain what you mean by expanding a post without expanding responses? I don’t know what’s left. I assume you’ve tried settings.

  5. lheydon Avatar
    lheydon

    Jens-Ingo Farley, I use this awesome bookmarklet daily without issue, except for over the past day or so Facebook now comes up with the message “It looks like you were misusing this feature by going too fast. You’ve been temporarily blocked from using it”. Clicking ‘OK’ makes the message vanish and then pop up again almost instantly, and this continues endlessly making Facebook totally unusable. This is even after aborting the bookmarklet script from running and reloading all Facebook pages. For me, the warning message eventually stopped happening after just sleeping on it overnight.

    Don’t know if this is something you can resolve, or whether it is just Facebook being themselves and blocking a third-party solution that tries valiantly to make their site actually usable!

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I have never gotten that message, and I just now expanded a thread with over 1,200 responses. If you do a Google search on the message (in quotes), there are 10s of thousands of hits. Many Facebook users encounter it. Do you also get this message if you expand without using this bookmarklet?

      1. lheydon Avatar
        lheydon

        No, I definitely have never got that warning message expanding threads without using the bookmarklet. I doubt I could do so manually clicking to be fast enough to ever trigger that detection.

        I searched the warning message before posting here, and I do appreciate that it is a common error message on Facebook and has a number of widely different causes. But I can say with a fairly high degree of confidence that at least one of those causes (at least very recently) seems to be when using your bookmarklet. Note that the thread I was using it on at the time had over 4,000 responses. So perhaps the thread expanding speed detection only kicks in at a certain threshold?

        1. Jens-Ingo Farley Avatar
          Jens-Ingo Farley

          I guess I’m lucky that I don’t see it. I only regularly expand threads with many fewer than 100 responses, and only while testing do I expand many threads with thousands of responses. If you found a specific threshold, then I’d guess it’s geo-locale specific, so even if you found your threshold, I wouldn’t expect it to be universal or timeless.

          1. lheydon Avatar
            lheydon

            Thanks for the response.

            When it next occurs, I will provide you with the link to the actual thread in question, so you can test it specifically. I don’t currently recall which thread it was that led to the warning message last time.

          2. lheydon Avatar
            lheydon

            Further to my last comment, it just now happened on the page below with only 600 comments.

            https://www.facebook.com/bbccomedy/posts/pfbid08zouMqHDAGDKdvjATTrKxYaZZkkhX9cu4SFCRqdVmhrK9nU9TXnqdPLPKDTv9dDYl

            Screenshot here: https://ibb.co/7W99RbQ

          3. Jens-Ingo Farley Avatar
            Jens-Ingo Farley

            Thanks for the URL. I expanded 557 responses, twice just to stress it, without error.

  6. lheydon Avatar
    lheydon

    Jens-Ingo,

    It just happened again on a post with 2,600 comments.

    Post: https://www.facebook.com/furrytailsofficial/posts/pfbid0nk9V48HmDiFwfCyNiLkyov42RndEm8SBiGVvA5wRp1gJuB6vusEeFw3cc42Fb2LAl

    Screenshot: https://ibb.co/SvfBGYh

    Have you stress tested this with running the script on multiple different posts in quick succession? Or simultaneously running it in more than one tab at once?

    Do you use a VPN when doing so?

    Thanks in advance!

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I loaded 2,535 responses without issue. I don’t use a VPN. I don’t run multiple expansions at the same time. I do run sequences of expansions, one thread after another. I personally use this daily to expand threads with many fewer than 100 responses, which I actually read.

      1. lheydon Avatar
        lheydon

        OK. It has happened to me again just now.

        Can you think of any other possible solutions? I really loved your bookmarklet, and Facebook is practically unusable without it.

        1. Jens-Ingo Farley Avatar
          Jens-Ingo Farley

          You can try slowing it down. There’s an assignment near the beginning of the bookmarklet:

          WAIT_TIME = 100;

          It’s in milliseconds. You can increase the value and see if that affects the problem.

  7. John Blackham Avatar
    John Blackham

    Facebook broke your code tonight. They must have rolled out some change because the expandall is no longer expanding.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I will look at it.

      1. lheydon Avatar
        lheydon

        Yep, can confirm now it just shows:

        [Press ‘s’ now for Settings]
        Responses = 54
        Expanding: Main content area

        And doesn’t expand anything.

  8. BT Avatar
    BT

    Came here to report brokenness, but I see it has already been addressed. Crossing my fingers for an eventual fix!

  9. Cheryl Spencer Avatar
    Cheryl Spencer

    I am also hoping for a fix to this super useful tool!

  10. Huseyin Sevay Avatar

    I’m very grateful especially for the ExpandAll marklet, which I use very often to save pages were I venture multiple opinions. Still I wish to keep what everybody else wrote as well for completeness.

    Thanks so much!

    I noticed the marklet stopped working (again!) 🙁

  11. Dawn Luks Avatar
    Dawn Luks

    Thank you for trying to fix this. Your Expand tool is amazing!

  12. Jens-Ingo Farley Avatar
    Jens-Ingo Farley

    I posted a status update at the top of the article.

    1. Cheryl Spencer Avatar
      Cheryl Spencer

      Thank you for the update and all your time and effort!

  13. BT Avatar
    BT

    Have you been tracking how often Facebook has been permuting its HTML over the last week or so?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      It’s been fairly stable. One area of visible change has been the showing\hiding of comments. I’m taking out the attempts I made at making sure comments are always showing.

  14. Varthall Avatar
    Varthall

    Thanks for all your work, your script has been in the last couple of years invaluable for me, I’m really looking forward for an updated version of it!

  15. Jens-Ingo Farley Avatar
    Jens-Ingo Farley

    I posted an updated bookmarklet today.

    1. Cheryl Spencer Avatar
      Cheryl Spencer

      Woo! Thank you!!!!!!!!

    2. Jener Gomes Avatar
      Jener Gomes

      Thank you very much!!
      Your bookmarklet gives us a big help to use the painful Facebook, offering this necessary resource.
      I discovered it in 2021 and quickly became used to it, I hope Facebook doesn’t mess so soon with its code.
      Again, thank you!!

  16. Kristi Avatar
    Kristi

    ‘Working here! Thank you (oh so VERY much!) You have made my world a much better place…and while it may seem like a small thing to some, it’s truly a life-changer for me.

    May you be blessed a thousand times!

  17. EB Avatar
    EB

    Thank you thank you thank you!!!

  18. Ivan Avatar
    Ivan

    You are – awesome!

  19. Michelle Avatar
    Michelle

    Hello, what do you mean with:->
    “As of 2022-09-16 on Vivaldi, – “Right-click the item (in my case “expand all”) you dragged, select Copy Link Address” ?

    I don’t have any “Link Address” to copy in that right-click menu on the item. And which exactly Url should I replace from ? FB URL from any groups ?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Right-click the item you dragged, not the item you dropped.

  20. Beny Avatar
    Beny

    Hi Jens, thanks for your effort
    I tried ‘expand all’ but it didn’t expand /’show all comments’ , only show ‘popular comments’. Could you help?

    Thanks in advance!

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      What language do you use Facebook in?

      1. Beny Avatar
        Beny

        I use bahasa Indonesia, is it only work in english?

        1. Jens-Ingo Farley Avatar
          Jens-Ingo Farley

          http://com.hemiola.com/2015/08/29/expand-all/#details

          Your clue was this being logged:

          > 1: ‘All comments’ not found. (b)

          I can add support for any Facebook language. I will add support for Indonesian shortly.

          1. Beny Avatar
            Beny

            Great! many thanks

          2. Jens-Ingo Farley Avatar
            Jens-Ingo Farley

            Done. On the download page.

  21. Beny Avatar
    Beny

    Hi Jens, I’ve tried the new one, but still no effect.
    Can you check? if it’s not possible then it’s okay in English.
    I’ll change language set to english then.

    1. Beny Avatar
      Beny

      bellow message,

      [Press ‘s’ now for Settings]
      Responses showing = 4

  22. Tphilsz Avatar
    Tphilsz

    It appears that the tool is broken. I am getting this message:
    [Press ‘s’ now for Settings]
    Responses showing = 3
    Expanding: Full-browser

    But nothing expands. Hoping you can fix this!

    1. Jener Gomes Avatar
      Jener Gomes

      Indeed. For two weeks I was on vacation and used Facebook much less, I noticed only now, it has the same behaviour in Brazilian Portuguese, in which the bookmarklet always worked amazingly (except after some code changes from Facebook).

  23. lheydon Avatar
    lheydon

    Jens-Ingo Farley, I know Facebook’s changes are frustrating but please don’t give up on maintaining and updating this tool! It’s the only thing that makes Facebook comment sections even remotely usable for so many of us! I for one will gladly donate again to either you directly or your chosen charity to motivate you to keep going with it.

  24. DarkAsylum Avatar
    DarkAsylum

    Jeez, why is Facebook so obsessed with such uncalled for changes? They’re trying to fix what’s not broken… by breaking it and not doing anything afterwards. So senseless.

  25. Dawn Luks Avatar
    Dawn Luks

    Love your Expand All tool.

    I will donate as well. Just tell me how.

  26. Jens-Ingo Farley Avatar
    Jens-Ingo Farley

    I fixed the bookmarklet and posted an update today.

    1. Jener Gomes Avatar
      Jener Gomes

      Thank you very much for the update! =D

      First try: The updated booklet worked perfectly expanding 14 comments.

      Hard test:
      Trying with 888 comments, the first run didn’t change anything, clicking again it worked beautifully.
      Testing again I saw this line in the middle of the disappearing window “Something went wrong. Not waiting.”, having success on the 2nd try, again.

      On Firefox 105.0.1 (64-bits) and content in Brazilian Portuguese.

      1. Jens-Ingo Farley Avatar
        Jens-Ingo Farley

        Is it reliably reproducible, at a public URL?

        It sounds like a timing issue. Could you be invoking the bookmarklet before the page is finished loading?

        1. Jener Gomes Avatar
          Jener Gomes

          I tested in a private group that I recalled has some big threads, I’ll try to find a public one (not my usual).
          I checked about the time, I waited a few seconds, without any change after the page looking like complete, having the same behaviour.
          One thing I noticed now is that on the first run the script changes from “most relevant comments” to “all comments”, then on the second click works.

          I found this post on a public group with the mentioned behavior: https://www.facebook.com/ExtraFabulousComics/posts/pfbid0CTu53cVuyYrJQQk5NNYrxAcEHyNUtdzyC56687VLCj3YRomfWv6dv4KGpngom1btl

          1. Jens-Ingo Farley Avatar
            Jens-Ingo Farley

            You’re saying you can go to the ExtraFabulousComics URL and reliably see the problem? I am unable to see a problem.

            Part of what’s going on is as follows: it finds the comment filter and that ‘All comments’ is not selected, so it clicks on it and changes the filter. For some mysterious reason unknown to me, it’s unable to find its way back to the post, hence the error. It can’t wait for comments to appear, so it stops.

            You run it again (by then, comments have leisurely appeared). It finds the comment filter and ‘All comments’ is selected, so it proceeds to expand the content without needing to open the menu.

            I need to be able to reproduce the problem to fix it.

          2. Jener Gomes Avatar
            Jener Gomes

            Yes, the behaviour occurs every time I reload the URL. But clicking twice (or selecting All Comments first) to have all the comments shown is great to me, I’m satisfied!
            Thank you for your attention and efforts!

  27. lheydon Avatar
    lheydon

    Jens-Ingo,

    I just tested this at that ExtraFabulousComics URL and got the exact same results as Jener.

    Left-hand screenshot shows my first attempt, I then waited until results screen went away and ran the bookmarklet again and got second successful result as shown in the right-hand screenshot.

    https://ibb.co/tqfypF5

    But I do realise your explanation already covers why this occurs (albeit mysteriously) so I’m not saying this is a major fault or anything, just letting you know that the same mystery behaviour exists for multiple users.

    Great work on fixing this bookmarklet again!!!

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I wish I had a way to reproduce it. I’m beginning to think it’s geolocation sensitive. Maybe it will suddenly start happening here, or stop for you/others.

      1. lheydon Avatar
        lheydon

        Feel free to let me know if there is any way I can replicate the problem and then debug it at my end and provide you with the outcome of the console or whatever (I’m clearly not a programmer! ).

  28. Jens-Ingo Farley Avatar
    Jens-Ingo Farley

    I attempted a blind, unverifiable fix for the ExtraFabulousComics problem. It’s the latest on the download page. Can someone seeing the problem check it?

    1. lheydon Avatar
      lheydon

      Have just repeatedly tested the blind fix update on the ExtraFabulousComics page and can confirm it does appear to have successfully fixed the problem.

      Many thanks!

      1. Jens-Ingo Farley Avatar
        Jens-Ingo Farley

        Thanks!

    2. Jener Gomes Avatar
      Jener Gomes

      Yes, I confirm, it worked on the first try! =D
      Again, thank you very much!!

  29. Dawn Luks Avatar
    Dawn Luks

    I’m seeing some weirdness today with the expand tool. It’s not fully expanding threads. “See more” messages are not expended. I’m pretty sure that they used to be.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      That’s a little nebulous. It seems to work for me. What language do you use Facebook in?

Leave a Reply to Ian Usher 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.