Orange Pig Word Replacer

This is a fun and simple project that replaces specific words on any webpage with your chosen alternatives. For example, it replaces the name of a certain orange Nazi president with "Orange Pig" and "Elon Musk" with "Felon Muskrat." It’s powered by a JavaScript script and the Userscripts app for Safari.

Example

A screenshot from CNN.com parsed by the filter.

How It Works

The script uses JavaScript to scan the text on a webpage and replace specific words or phrases. It also handles dynamically loaded content (e.g., AJAX) using a MutationObserver.

How to Install

  1. Download the Script: Download content.js
  2. Install Userscripts: Download Userscripts for Safari.
  3. Add the Script to Userscripts:
  4. Enjoy! Visit any webpage, and the script will automatically replace the specified words.

About Userscripts

Userscripts is a free and open-source Safari extension that allows you to run custom JavaScript (and CSS) on websites you visit. It’s perfect for small tweaks, like this word-replacement project.

Customizing the Script

You can easily modify the script to replace other words or phrases. Open the content.js file in a text editor and update the replace functions with your desired replacements.

Repository

This project is part of a collection of AI and coding experiments. Check out the full repository here.