Dreamwidth Blocker Userscript
Description
The Dreamwidth Blocker is an experimental userscript that makes it possible for users to hide comments and threads on FFA based on keywords, like Tumblr Savior and xkit's Blacklist extension. This is designed to make it easier for users to avoid spoilers and ignore comments and threads that they find boring, annoying, inflammatory, or upsetting. Although the script is currently limited to work on FFA, it can also be set up to work with other Dreamwidth communities. As of version 0.2, the script is designed to work with flat view, top-level view, and threaded view.
Once the userscript is installed, a small "Blocker" button will be displayed in the upper-right corner of affected pages. This button opens the settings panel for the blocker, where the user can add blacklisted and whitelisted words and phrases, and change various settings that affect which comments are hidden. Once the user is satisfied with the settings, they can refresh the page, and the userscript will replace filtered comments with a message indicating the reason for the block.
Click here to install the latest version of the userscript.
Installation Instructions
Firefox and Greasemonkey
- Open Firefox.
- Go to the addon page for Greasemonkey.
- Click the button that says "Add to Firefox."
- Wait until the install window comes up, then click "Install Now."
- Go to the latest version of the userscript.
- When the Greasemonkey Installation window pops up, wait until the "Install" button becomes available, then click it.
Chrome and Tampermonkey
- Open Chrome.
- Go to the Tampermonkey website and click the "Tampermonkey Stable" button.
- Wait until the popup appears, then click "Add."
- Go to the latest version of the userscript.
- On the webpage that opens, click the "Install" button.
Enabling for Additional Communities
The Dreamwidth Blocker was originally created for use with FFA, and as a result, the script only works on FFA by default. However, it can be extended to work with a number of other Dreamwidth communities and journals, with a few caveats.
Greasemonkey Instructions
- Click the Greasemonkey icon in your toolbar to open the Greasemonkey menu.
- Click on the "Dreamwidth Blocker" menu item.
- Click the "Edit" button.
- Find the line that begins with // @include, and copy the whole line. Paste a second copy of the line just below the first one.
- Edit the URL as desired. If you wish to enable the script for all DW websites, enter *://*.dreamwidth.org/* as the URL to include.
- Save the script by pressing Control S.
Tampermonkey Instructions
- Click on the Tampermonkey icon on your toolbar. (It's the one that looks like a black square with two circles cut out of the bottom.)
- When the menu opens, click the "Dashboard" option.
- Click on the "Dreamwidth Blocker" user script.
- Click on the "Settings" tab that's next to the "Editor" tab (not the one at the top of the page).
- Click the "Add ..." button underneath the "User includes" section.
- Enter the URL of the DW community you wish to include, followed by a *. For example, https://fail-fandomanon.dreamwidth.org/*. If you wish to enable it for all DW websites, enter *://*.dreamwidth.org/* instead.
- Press "OK."
Known Bugs
- The script works by searching the website's HTML for elements with certain class names, and will not work if those class names have been changed from the default. As a result, there may be some Dreamwidth communities that the userscript will not work with by default. (It should be possible to make it work again by viewing the site with ?style=site or ?format=light appended to the URL.)
- The script also relies on having certain metadata inserted into the header by Dreamwidth, so it won't work on any other sites (like LJ).
Older Versions
- The initial version of the userscript.
- Doesn't work with top-level comment view.
- In newer versions of Greasemonkey, there is a bug that breaks the script's ability to filter comments loaded after the page is loaded (by clicking "Expand").
- Fixed the bugs surrounding comments loaded after the page is loaded (i.e. by clicking expand). This worked (briefly) on initial release, but then Greasemonkey updated their security settings, and it stopped working. Now it should be fixed again.
- Added the ability to filter comments in top-level comment view. (Basically, this is just the above bug fix + a few lines of code to make sure that comments are processed at the right time in top-level view.)
- Changed "block by thread" to "block all replies" — it works pretty much the same as before for all top-level threads, but additionally allows you to block, e.g. whole subthreads that include one of the terms you're blocking in the title.
- Added a checkbox to let the user decide whether they want regex keywords or not. This should make it easier to deal with special characters.
- Added the ability to export/import settings, to make it easier to transfer block lists between browsers and preserve block lists through reinstalls.
- Added the ability to edit the CSS for blocked comments. For those who know CSS and hate pink, this will let you change the background color of those "Blocked for containing ..." messages. (You can even hide those messages, if you're absolutely positive that your blacklist isn't going to accidentally block things it shouldn't, but this isn't recommended.)
- New tabbed interface to accommodate the new features.
- Hovering over options in the "Settings" tab should now show some more explanation of what the feature does, including important caveats.
- Fixed a bug caused by the latest update to Firefox.
- Modify pattern to include https.
- Added Greasemonkey 4 compatibility.
- Removed localStorage fallback code, since it doesn't work with Greasemonkey 4's polyfill script.
- Changed blocked message to include all reasons for blocking.
- Modified the code for loading comment info.