/hide-comments-everywhere

A browser extension for hiding major commenting systems like Disqus, Livefyre, Facebook plugin, WordPress, YouTube, etc.

Primary LanguageJavaScriptMIT LicenseMIT

Hide Comments Everywhere

Fed up with the vitriol left in comments, many sites are dumping their comment systems completely. It's just too costly to monitor them, so they tend to devolve into a cess pool. Personally, I just want the content most of the time. YouTube anyone?

To help with my own sanity (and maybe yours?), I wrote an extension that hides many comment systems - identifying them is somewhat predictable. It's available for Chrome and Firefox, or you can read more about it here too.

What sites does this work on?

A lot, including but not limited to:

  • YouTube
  • Twitter
  • Reddit
  • Disqus
  • Livefyre
  • WordPress
  • Loads of other comment systems and individual sites. If this is hiding anything unexpected, like some site that assigned the "comments" ID to the main content of their posts, then just let me know and I can make adjustments.

What doesn't it work with?

Some sites, like Facebook and Instagram, use random element identifiers and class names that change often. It's difficult to manage them and takes a lot of time, so I've thrown in the towel on them.

You might want to check out Fluff Busting Purity for Facebook or Antigram for Instagram. I'm not sure if either blocks comments, but at least you can cut out a lot of time-sucking distractions.

How does it work?

This extension checks whether comments should be disabled for the current URL, and is triggered when the page is first loaded or the URL changes (i.e. you click a link).

  1. First, it checks the sites.json file for known DOM elements that contain comments on the current URL.
  2. Then it sees if you've chosen to exclude the current URL (the whitelist on the Options page under Filters).
  3. It injects a CSS stylesheet into the page that sets display style to "none" for comments (and anything related, like comment counters).

The allowed (whitelisted) sites are ones you define on the Options page. Specify a list of URLs as regex patterns, one per line, that should display comments all the time (the extension is effectively disabled for those URLs). Your list of allowed sites uses synchronized storage, so it should be available on any machine you've installed the extension on and are logged into.

  • You can quickly add the URL of the current page by opening the extension popup (click the icon in the toolbar), and then selecting a URL (or entering a custom one) and pressing the "Allow" button. Note that, unlike the "options" page, these URLs are entered normally and not as regular expressions.
  • Note: There's also a hard-coded whitelist, although I don't anticipate adding very many sites to it. One I added is GitHub, for which it's unlikely anyone would want to hide comments. There are issues with their DOM that cause legit sections of the site to be hidden.

Click on the icon in the toolbar and press the large "toggle" button to temporarily toggle enabling/disabling the extension for a single tab, in order to hide or display comments. Click it again to toggle it back. Reloading the page will cause it to follow the same rules as above, looking first at blocked sites and then your personal allowed sites.

Permissions

You'll be notified that it can "read and change all your data on the websites you visit" because that's how it works - it hides certain comment-related elements on the page so you don't see them.

It also uses storage to save its state, but it shouldn't prompt you for that.

I need your help!

If you notice a commenting system that should be added (blocked), open an issue for that. Include the website where you noticed it, or create a pull request with the necessary changes to the "sites.json" file, and I'll follow-up as time permits.

Thanks!

Need help? Have a request?

Open a new issue with as many details as possible. The more you let me know upfront, the less I'll have to ask later!