Detrumpify: About

Get Detrumpify:
For Chrome For Firefox For Edge
Where’s Safari?

If you like this plugin, please consider “liking” our Facebook page.

What is it?

Detrumpify is a simple browser extension that I originally wrote in a fit of pique and have been incrementally enhancing ever since. Donald Trump is a doofus-vampire who, despite being epically wrong about just about everything, seems to have a magical sway over the media and, most unfortunately, a big chunk of the electorate.

I got tired of seeing his name repeated endlessly, so I chose to do something small about it. I took a list of excellent insults compiled from Jezebel.com and used them to create a little program that substitutes them every time you-know-who’s name appears.

Siex3nce then, I’ve expanded the list with more insulting monikers culled from the Internet, as well as a few of my own and suggestions from users. I’ve also expanded the program, by providing many options to alter its behavior. In fact, Detrumpify is really a rather generic tool now, usable to replace any text with any other text, in any webpage. What makes it “Detrumpify” are the built-in settings.

Use

Using Detrumpify is simple. Simply install it from the Chrome Web Store,  Firefox Add-Ons page, or the Microsoft Store (for Edge). Then visit a news site and you should see Trump and his friends being replaced

If you click on the no-Trump icon, you can make some configuration choices such as:

  1. clean, dirty, or mixed insults
  2. maximum length (in words) of insult
  3. any scare-quotes or brackets for the insult
  4. apply a CSS style to the insults
  5. how often do the insults change (with every mention, daily, etc)
  6. If the configuration has more than one “action” (word it replaces) you can control which actions actually run.
  7. much more!

It is (or maybe was) possible to also load an external configuration file that you’d have to host on DropBox, but newer version of all the browsers are enforcing security settings that make that work or not work under circumstances I do not quite understand. See below for more information on custom configurations.

Customization and Options

Please take some time to explore the options in the drop-down menu that appears when you click the Detrumpify icon in your toolbar. There are many options to control the behavior of the plugin. You can select among “canned” configuration files, control formatting, control insult maximum length, turn on mock-o-matic and “Bard” mode and many other options.

Whitelists and Blacklists

I wanted Detrumpify to be fun, and if it is making it hard for you to use your computer, that’s not fun. For example, it can be annoying to have Detrumpify replacing text in your email editor as you type.

Because of that, I initially designed Detrumpify to only run on a specific list of websites. Over time, I have refined this model, and now Detrumpify has the option to work with a whitelist or a blacklist. Essentially, in whitelist mode, Detrumpify will only affect websites whose domain name appears in the whitelist. In blacklist mode, Detrumpify will on all sites except those in the blacklist. Both of these settings are available in the settings menu.

Styles

By popular demand, I have made it easier for users to change the appearance of Detrumpify insults.

First, if you want to edit the config file, you can still do so. Simply set a key called match_style  to a value that is a valid CSS style for span element, and that style will be applied to all insults.

However, you can now specify such a style right inside the extension options section.

There are books on CSS styling, but to get you started, the basics are that you can string together any number of “ name: value; ” elements to get your desired style.

Some examples:

color: purple; Makes the text purple.
font-style: italic; Makes the text italic.
background-color: yellow; Makes the background yellow.
background-color: blue; color: red; font-style: italic; makes red italic text on a blue background (not recommended)

It’s not working!

Please check to see if the site you are looking at it blacklisted or whitelisted as described above.

If Detrumpify is still not working, it is probably because the website you are looking at loads content dynamically. Basically, by default, Detrumpify runs when a page loads and then it stops. Unfortunately, for some sites like Facebook and Reddit, this won’t get you what you want because the content itself is loaded later, potentially much later.

To deal with sites like these, there is an option in the configuration menu called “scan on change.” When this mode is clicked, Detrumpify will re-scan the page whenever it detects a “mutation”. The cost is slightly higher CPU use.

Custom Configuration Files

All the insults that Detrumpify uses are loaded from configuration files that I host on toolsofourtools.org. Detrumpify also supports you loading your own completely custom configuration problems.

This is what a configuration file looks like. Hopefully it’s mostly self-explanatory.

If you would like to make a custom configuration file, I recommend that you first download one of my files and make changes to it locally. You can find URLs for downloading my files in the configuration menu.

After making your modifications, make sure the file is still valid JSON by running it through a JSON linter. On the web, you can paste your code into jsonlint.com

Custom File Hosting

Once you have a file that you think is good, you need to host it where Detrumpify can find it. This used to be pretty simple: you could put the file up on the web anywhere and just point Detrumpify at the URL.

However, over the past couple of years this has become more difficult because security constraints make it hard for extensions to load code from foreign websites. In fact, these constraints pretty much break this feature, and the “breakage” varies by browser and maybe platform. (For those interested, the security issues are 1) permissions limitations in the extension’s manifest and 2) CORS.)

There are two methods that still seem to work for managing custom files: Dropbox and local hosting.

Using DropBox

If you want to try DropBox, create and account and upload your .json file to DropBox. Then, click “share” to make it world-viewable, and copy the link it gives you. The link might look like:

Now you will have to modify the link in two ways. First, chop off the “ ?dl=0 ” and replace the domain name with dl.dropboxusercontent.com

The new URL will look like:

Paste this into Detrumpify, and with luck you should be able to load the configuration file.

I have tested this and it works, as for December 2018 it works with all of Chrome, Firefox, and Edge.

Hosting a file locally

Detrumpify should also be able to load URLs that point to “localhost”. This does not work with Edge, which forbids it for some reason. However, this requires that a web server be running on your machine, at least temporarily, while you are loading the file. (You can shut it down once Detrumpify has the configuration.)

If you have a Mac or Linux, everything you need to do this is already installed. On a PC, you’ll need to install something.

I’ll give an example with the server built into Python.

First, open a terminal window. Create a directory to hold your config file and “cd” to it. Copy your configuration file(s) to this directory. Lets say you named it “ myfile.json “

Next, issue the command:

python -m SimpleHTTPServer 8000

Now, go into the Detrumpify config screen and paste:

and click save. With any luck, the file will load properly. If you do “show configuration details” you should see your config text.

At this point, you can close the web server and close the terminal until you want to load another file.

This works for Chrome and Firefox.

 

 

Privacy

Detrumpify extensions/plugins never collect or transmit any information from you whatsoever.

If you are using one of the default config files, the Chrome extension will GET the config file URL weekly in order to check for new insults. This URL is https, so the request and response are encrypted, but someone scanning your network traffic could tell that you are hitting toolsofourtools.org.

License

Detrumpify is an open-source project available on github.

Who am I?

I’m a guy who likes to blog about public policy and technology, and who wrote a Chrome extension because he was fed up. My name is David. ToolsOfOurTools is this blog and is a reference to Henry David Thoreau, who suggested that we are somewhat enslaved by the things we make.