POOF! What was that post that flashed by?

The filtering on the Fox News Forum is done mostly server-side. I say mostly as from observation is appears a few of the more noxious words are filtered client side.

Livefyre first records the post and then later goes back and updates it to mark it deleted. That’s why sometimes is it noticeable that posts flash and then disappear. But because of this two-step process, it is possible to catch the event where the comment is marked as deleted and then restore the original comment. When this is done the the code I have implemented for this also places a light red background on the post so you know it is a deleted post. It does not appear possible to make a restored post reply-able but perhaps with some more investigation that could be done.

As a note, it is not possible to detect whether a post was filtered or was, in fact, deleted by the user. Thus why I use filtered and deleted interchangeably in this post.

The code below words by creating a  DOM Mutation Observer which watches for any mutations, (changes), in the HTML structure and elements for the comment stream and then, when it detects changes indicating a comment was deleted, reverses those changes.

This code also immediately marks deleted posts as visible so you will see filtered posts accumulate at the top of the comment section if you have New Comments, i.e., 96-new-comments,  you have not clicked on to see yet. Once those new comments are loaded the filtered posts will appear in their proper place.

The code below creates a DOM Mutation Observer which watches for and restores deleted livefyre comments.