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. Dawn Luks Avatar
    Dawn Luks

    English.

    What I meant was that longer messages that have “see more” at the end, do not expand to their full length.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Can you provide a public URL with the problem?

      Can you verify whether this URL has about 70 See mores that get expanded, as is the case for me:

      https://www.facebook.com/theguardian/posts/pfbid0322YLJfSvbwQ6YC5nJuby36zTR9ZfJ8rBMvvykRqBY95kwHGCvTVqWhGtWgc8Lczsl

      Or are you saying that See mores are clicked but only partially show more?

      1. Sally Avatar
        Sally

        Jens-Ingo Farley, I am sure that if anyone in the world is going to be able to assist me it is going to be you … my family has been persecuted by a group fans page that has hidden the admins, I have tried everything to gain access to see who the admins are ? I am begging you to please assist with your expertise and save my family here is the link :
        https://www.facebook.com/profile.php?id=61553138050468&sk=about_profile_transparency

        1. lheydon Avatar
          lheydon

          Sally,

          I’m afraid you are unlikely to have much luck in posting your issue here.

          Firstly, I’d assume Jens doesn’t even have the technical ability to determine the admins of that page. From what I understand, his skills are in managing and optimising Facebook from the front-end (user) of it, not with finding secret or hidden information on the back-end (company).

          Secondly, even if he could, I’d imagine the admins would be using fake accounts anyway that could not be tied to their real-life identities (except perhaps with a legal subpoena served on Facebook).

          Thirdly, even identifying them properly still would not get the page itself taken down.

          What you need to do instead is report the profile to Facebook as defamation using this form:

          https://www.facebook.com/help/contact/430253071144967

          Make sure you take full and complete screen captures of every single part of the page to keep as evidence BEFORE reporting it, however.

          In the event that Facebook don’t take the page down themselves , I would suggest you consult a lawyer in your jurisdiction (South Africa?) who can write a formal letter to Facebook’s legal department raising those concerns. This will bypass all of Facebook’s frontline customer service staff (who are all pretty useless) and instead bring it to the attention of real people who are actually concerned with Facebook’s legal liability in every country where it operates.

          Hope this helps.

          LH

  2. Dawn Luks Avatar
    Dawn Luks

    Here’s one.

    https://www.facebook.com/groups/CompuserveSYSOPs/posts/10157858262066056

    After running the tool, the See More’s remain un-clicked.

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      It works for me, which basically proves that geolocation affects HTML (different locations get different HTML). I have no way of fixing it.

      What are your results of loading the URL I provided? I’m just curious if some posts work for you and others don’t, or if they all don’t.

    2. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I think I can sort of guess what’s going on, but it’s perhaps too risky to make changes that I can’t test. For nearly the exact same reasons that changing the comment filter was failing, I can imagine clicking See more failing.

      I will keep thinking about this and whether I can safely accommodate the change, being that I can’t test it.

      1. lheydon Avatar
        lheydon

        I know it would involve more complexity, but could you perhaps fork off another separate version covering this issue for people experiencing it, without risking the performance of the standard version for people not experiencing it?

        Note that I’m not experiencing this issue myself.

        1. Jens-Ingo Farley Avatar
          Jens-Ingo Farley

          I think that Facebook will eventually converge on one way of delivering content. Either the problems others see will go away or I will start seeing the problems (or Facebook will rebuild and break this tool again).

          It’s really not a performance concern as it is a functionality concern.

          In any case, branching and merging would add more complexity than I want to deal with. For now, I’ve attempted a “safe” fix.

          1. lheydon Avatar
            lheydon

            No problem. You’re already doing amazing work just with updating the regular bookmarklet! Right now, in terms of improving everyday usability and saving hours of frustration, you’re probably the most essential person on the internet as far as I’m concerned.

          2. Jens-Ingo Farley Avatar
            Jens-Ingo Farley

            What ever happened to your issue where Facebook would say “It looks like you were misusing this feature by going too fast. You’ve been temporarily blocked from using it”?

          3. lheydon Avatar
            lheydon

            Jens-Ingo,

            I think I’ve reached the depth limit for nesting responses, so will respond here instead.

            >What ever happened to your issue where Facebook would say
            > “It looks like you were misusing this feature by going too
            > fast. You’ve been temporarily blocked from using it”?

            I had a similar Facebook warning message (although notably different from previous ones) occur when running the bookmarklet on a single occasion back on 1 October 2022, per screenshot below:

            https://ibb.co/yhqZcKg

            But then absolutely no issues whatsoever since then, so I’m assuming it is currently resolved/no longer happening for whatever reason (yours or Facebook’s).

            I will definitely keep you updated here if it returns in the future though.

  3. Dawn Luks Avatar
    Dawn Luks

    The “See More” problem affects every post that’s long enough to have a “see more” at the end. Even in the 700 message post.

    Thank you for looking into this!

    Dawn

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Try it now.

      1. Jener Gomes Avatar
        Jener Gomes

        I noticed this today, now I tested the new bookmarklet and it’s working well for me! Its last step was to expand successfully all the “See more”.
        Thank you very much, again! =)

  4. Dawn Luks Avatar
    Dawn Luks

    Jens-Ingo,

    “See more” is now fixed!

    Thank you so much!

    Dawn

  5. lheydon Avatar
    lheydon

    Jens-Ingo,

    Quick semi-related question I figured you’d know as a Facebook wizz. Is there a way of taking a Facebook page that has the photo on the left and the comments in the thin strip on the right, and change the URL so it displays in the more accessible manner with the photo top-centre and the comments beneath it? I’ve noticed that some such pages switch from the first mode to the second when you click the timestamp on any specific comment, but some do not (like the example below).

    Example page:

    https://www.facebook.com/lordofthefriesau/photos/a.379329286706/10158456091226707/

    Note that your Expand All bookmarklet does still work here, but it only expands the comments within the constraints of that thin strip. Which is certainly still heaps better than nothing. I’m assuming that the bookmarklet tries to change the page to the mode I mentioned preferring, but cannot do so on certain kinds of Facebook page?

    Thanks!

    Leigh

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      Videos are worse, as you probably know. The comment area on the right scrolls horizontally and vertically (if you can access it at all) and is almost completely unusable. But then the comments on videos are almost all uninteresting anyway.

      I, too, have noticed that some posts can switch between photo-on-top and full-browser viewing. Bottom line: I don’t know how/if you can easily control it.

      The bookmarklet is slightly less sophisticated than you describe. It only automates clicking. It does not rewrite the CSS (stylesheets), which I think is more what you’re looking for.

  6. lheydon Avatar
    lheydon

    Jens-Ingo,

    Oh goddamn Facebook, I’m today back to getting that incredibly annoying ‘You’re Temporarily Blocked. It looks like you were misusing this feature by going too fast. You’ve been temporarily blocked from using it’ message again!

    I’m really starting to hate Facebook even more as a company than I did already!

    https://ibb.co/9yjkfDH

    Can you remind me again what was the part of the bookmarklet I can edit to increase the interval between ‘clicks’ and slow it down?

    Thanks!

    Leigh

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      There’s an assignment near the beginning of the bookmarklet:

      WAIT_TIME = 100;

      It’s in milliseconds. To slow it down, you can increase the value.

      1. lheydon Avatar
        lheydon

        Goddamn it!

        I had set it to 1000 (i.e. ten times the default value) and had thought I was error-free for several days, but today the warning message returned while running the bookmarklet. I am so sick of Facebook and their constant bullshit!

        Guess I’ll try it at 2000 for a bit, although eventually it will reach a point where it stops being very useful in practical terms.

        1. lheydon Avatar
          lheydon

          Damn, 2000 also leads to the same warning message.

          Will try 5000.

          F**king Facebook!

          1. lheydon Avatar
            lheydon

            Oh goddammit, I had been successfully using it set at 5000 since November, but today the issue returned for the first time at that setting!

          2. lheydon Avatar
            lheydon

            Oh great, now Facebook are even limiting me when I use the bookmarklet with a massive delay of 10,000!

            For any post with a large number of nested comments where you are tagged in a response and need to find it in order to respond/react, f**king Facebook is becoming practically unusable within a web browser!

  7. Steve Avatar
    Steve

    Love the bookmarklet. I’ve been using it a while and the comments I am opening up have links inside, some to Dropbox, some to other places. They are truncated by FB so I need to go thru and click manually on each one. Is there a way to have each link shown in full that anyone is aware of? Then I could just highlight all the text and have all the URLs open in a separate tab with a couple of clicks?

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      I really don’t think you want to do that. You don’t want a bunch of orphan URLs to pop up in multiple tabs. Those are generally called pop-ups, are generally unwanted, and browsers spend a lot of resources to block them.

      You might have noticed that in addition to the URLs being obfuscated/truncated, they go through l.facebook.com. This is ostensibly for tracking purposes. You can extract the URL from the ‘u’ parameter, but it needs to be decoded. This is all fine, but doing it automatically I don’t think is desired.

  8. Konstantin Avatar
    Konstantin

    Thank you for the script. Is it possible to load all comments from the search result in specific group ? I mean it loads only first or active search result. I want to use page search for the query i enter into the search bar to find it between comments

  9. Martin Avatar
    Martin

    It does look like FB has changed its way of displaying comments once again. Comments below a post will be opened in a window of their own every time. At least this is the case here.

    I hope a workaround is still possible.
    Thanks for your bookmarklet.

    1. lheydon Avatar
      lheydon

      Yeah, noticed that has come in over the past few days on a computer. Presumably a workaround is to open the specific post itself in a new tab, either by clicking the timestamp of the post, or for sponsored posts which don’t have a timestamp and instead the non-linked word ‘Sponsored’, clicking the timestamp of any one of the sub-comments on the post.

  10. aaa Avatar
    aaa

    i think it has stopped working?

  11. lheydon Avatar
    lheydon

    Jens-Ingo,

    Your extension is still working well for me, albeit with the Facebook-imposed massive speed limitations which I’ve described previously here.

    Would you consider writing one of these bookmarklets for YouTube comment sections? I can forward you a detailed description and screenshots of the specific issues it would be targeting, and am happy to support you/charity with a donation 🙂

    1. Jens-Ingo Farley Avatar
      Jens-Ingo Farley

      It still works for you? That is mystifying to me, as it hasn’t worked for months for me.

      I will not be creating an expansion tool for YouTube.

      1. lheydon Avatar
        lheydon

        Yep, it’s still definitely working for me. Would you like me to provide any relevant information to help you work out why and possibly fix it at your end or for anyone else it currently isn’t working for?

        Remember, I did need to massively crank down the click speed settings in order to stop Facebook assuming I was a bot and putting up a warning message. I’m not sure if that is the kind of issue at your end that you are meaning?

  12. Jener Gomes Avatar
    Jener Gomes

    Well, I understand that creating and maintaining scripts to circumvent Facebook annoyances was too demanding, so, I thank you very much for creating and sharing this great and very useful bookmarklet!
    By the way, it still works for me on most of the Facebook pages, I’ll enjoy its final moments of glory.

    1. lheydon Avatar
      lheydon

      It’s just a damn shame he doesn’t need the money. Enough people hate that problem with Facebook, and waste literally hours of their lives endlessly expanding comment sections, that he could probably make a tidy little side income if his scripts were more widely known (and were always able to adapt to underlying Facebook changes).

      I personally would probably pay like $50/year for this convenience. Although of course the scripts can also be pirated easily, so it would require enough honest people to pay.

  13. Anon Avatar
    Anon

    Thanks for what you did, it was a golden age when it worked for 2100 comment threads!

  14. Rasmus Underbjerg Pinnerup Avatar
    Rasmus Underbjerg Pinnerup

    Just saw the June ’23 discontinuation notice. I totally understand. I just wanted to leave a huge thank you for all the work you’ve done and the functionality you’ve provided while it lasted. I hope that somehow the kindness you’ve shown will be reflected back to you 🙂

  15. Aunty Meta Madnuss Avatar
    Aunty Meta Madnuss

    “I just wanted to leave a huge thank you for all the work you’ve done and the functionality you’ve provided while it lasted. I hope that somehow the kindness you’ve shown will be reflected back to you ”
    – Rasmus Underbjerg Pinnerup
    Hear hear.
    Exactly my sentiments.
    Hats off to you Jens-Ingo.

Leave a 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.