Due to the upcoming deprecation of XUL-based add-ons, I am stopping development and support for this add-on. E-mail me if you’d to take over development.
Comment Snob is an extension for Google Chrome and Mozilla Firefox that filters out undesirable comments from comment threads on the Web. You can install it in Chrome or install it in Firefox.
It comes with support for YouTube by default, but you can add support for many other sites by installing Comment Snob rules. For each rule that you install, you can choose from the following filtering parameters:
- All capital letters
- No capital letters
- Doesn’t start with a capital letter
- Excessive punctuation (!!!! ????)
- Excessive capitalization
- Profanity
- Contains any words or phrases that you deem objectionable.
Installing Comment Snob Rules
There are two ways to install a comment snob rule:
- Click on a Comment Snob rule link in a webpage. A bar will appear at the top of your browser allowing you to install the rule. (Try clicking this link: Comment Snob Rule for Mashable)

- Or, open the Comment Snob options and write your own Comment Snob rule.

Featured Comment Snob Rules
Writing a Comment Snob Rule
Are you familiar with HTML and jQuery? Then you can write Comment Snob rules for any website you want.
Components of a Rule
A Comment Snob rule is a JSON object that tells Comment Snob how to find comments on a website and where to place the “Show/Hide” toggle for each comment. These are the properties that each rule should (or can) have; all selectors should be written for consumption by jQuery:
| Attribute | Required | Description |
|---|---|---|
| id | Yes | A string that should be unique to your rule. This is used to make sure that the same rule is not installed multiple times. |
| label | Yes | A string that describes your rule to a user. It will usually be the name of the website that it filters. |
| url | Yes | A regular expression (encoded in a string) that describes the URLs for which your rule should be run. |
| allCommentsSelector | Yes | A selector that selects the smallest possible container that contains all of the comments for the page. |
| commentContainerSelector | Yes | A selector that selects the largest possible container that contains only a single comment, using allCommentsSelector as a starting point. |
| commentTextSelector | Optional | A selector that selects the smallest possible container that contains all of the text for a comment, using commentContainerSelector. If not specified, defaults to commentContainerSelector. |
| commentHideSelector | Optional | A selector that selects any nodes that should be hidden when a comment is filtered, using commentContainerSelector as a starting point. If not specified, commentTextSelector will be used. |
| statusElementTag | Optional | The HTML tag name that should be used to hold the “Show/Hide” toggle and the reason for filtering. If not specified, defaults to “span”. |
| statusContainerSelector | Optional | A selector that selects the element that will be used as a point of reference for where the “show/hide” toggle and filtering reason is placed for each comment. If not specified, defaults to commentContainerSelector. |
| statusPlacement | Optional | One of “prepend”, “append”, “before”, or “after”; used along with statusContainerSelector to insert the filtering status into each filtered comment. Defaults to “prepend”. |
| statusElementAttributes | Optional | A hash containing name/value pairs for attributes that can be added to the placeholder element specified by statusElementTag. |
| ajaxInitiatorSelector | Optional | A selector that selects any UI elements that might be clicked to trigger loading more comments via AJAX, using allCommentsSelector as a starting point. |
| dynamic | Optional | A boolean value (defaults to false) that indicates whether the website’s comments are not included in the main pageload, but are immediately loaded after the page loads. Disqus is the most common example of this. |
| updateURL | Optional | A URL where the JSON for this rule can be retrieved (for automatic updates). |
| author | Optional | Your name, email address, or website. |
| description | Optional | A text description of your rule, only recommended if the label doesn’t fully describe the functionality. |
The simplest possible rule might look like this:
{
"id": "test@example.com",
"label": "Example.com",
"url": "^http://example\\.com/",
"allCommentsSelector": "#comments",
"commentContainerSelector": ".comment"
}
Rule Discovery
To let users install your rule, just link to a file that ends in .snob and contains only the JSON, or make your link in this format:
data:text/snob+json;base64,[base64-encoded JSON here]
Questions?
E-mail me at cfinke@gmail.com.
Leave a Reply