A Chrome extension (Manifest V3) that replaces Trump-related terms and images on webpages with configurable lorem ipsum text and orange placeholder images. Fully customizable via the options page with support for English and Dutch.
β¨ Configurable Text Replacement
- Replace Trump-related terms with custom lorem ipsum or any text you prefer
- Enter multiple replacement texts (one per line) for random selection
πΌοΈ Image Replacement
- Automatically detects and replaces images containing "trump" in metadata
- Replaces
<img>tags,<source srcset>elements, and CSS background images - Uses an inline SVG orange placeholder image
π Multi-Language Support
- English and Dutch UI language options
- Settings saved per language preference
βοΈ Advanced Options
- Enable/disable the extension without uninstalling
- Case-sensitive or case-insensitive filtering
- Periodic DOM rescanning (every 2 seconds) for stubborn stylesheet updates
- Mutation observer for dynamic content detection
(If published)
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in top right)
- Click "Load unpacked"
- Select the project folder
The extension is now active on all websites you visit!
Option 1: Right-click the extension icon β "Options"
Option 2: Go to chrome://extensions β Find "Trump Text Replacer" β Click "Details" β "Extension options"
- Toggle "Extension enabled" to temporarily disable/enable without uninstalling
- Enter one search term per line (e.g., "Trump", "Donald Trump")
- All occurrences are replaced (case-sensitive or insensitive based on settings)
- Default:
Trump,Donald Trump,President Trump,Trump Jr.
- Enter one replacement text per line
- Each replacement randomly selects from these options
- Default: Lorem ipsum sentences
- Case-sensitive filtering: When enabled, "Trump" β "trump"
- Language: Choose between English (English) or Dutch (Nederlands)
-
Settings Storage: All settings are stored in
chrome.storage.sync- Synchronizes across devices using the same Google account
- Persists between browser sessions
-
Content Script: On every page load, the content script:
- Fetches settings from
chrome.storage.sync - Checks if the extension is enabled
- Builds a dynamic regex from your filter words
- Scans the entire DOM for text, images, and backgrounds
- Replaces matches with your configured text/images
- Fetches settings from
-
Dynamic Updates: A
MutationObserverwatches for:- New DOM elements being added
- Attribute changes (src, alt, style, etc.)
- Periodic rescans every 2 seconds for stubborn stylesheets
trump-text-replacer/
βββ manifest.json # Chrome extension configuration (Manifest V3)
βββ content.js # Main script that performs replacements
βββ options.html # Settings page UI
βββ options.js # Settings page logic (load/save)
βββ options.css # Settings page styling
βββ icons/
β βββ icon16.png # Extension icon (16x16)
β βββ icon48.png # Extension icon (48x48)
β βββ icon128.png # Extension icon (128x128)
βββ README.md # This file
- Modern Chrome extension format
- Supports
chrome.storage.syncfor settings persistence - Uses
options_uifor the settings page - Content script matches all
http://*andhttps://*URLs
Filter words are escaped and combined into a word-boundary regex:
- Case-sensitive:
/\b(Trump|Donald Trump|President Trump|Trump Jr\.)\b/g - Case-insensitive:
/\b(Trump|Donald Trump|President Trump|Trump Jr\.)\b/gi
Images are considered "Trump-related" if they contain "trump" (case-insensitive) in:
altattributetitleattributearia-labelattributesrcURL- Background image URL
- Text nodes: TreeWalker skips
<script>,<style>,<textarea>,<input>elements - Attributes: Mutation observer monitors
src,alt,title,srcset,style,class - Rescan: Every 2 seconds to catch dynamic content and stylesheet changes
Text strings are managed in options.js via the TRANSLATIONS object:
const TRANSLATIONS = {
en: { /* English strings */ },
nl: { /* Dutch strings */ }
};Add more languages by:
- Adding a new language object to
TRANSLATIONS - Adding a new
<option>to the language selector inoptions.html - Updating the UI text with
data-i18nattributes
- Chrome 88+ (Manifest V3 support)
- Edge 88+ (Chromium-based)
- Other Chromium browsers (Opera, Brave, etc.)
- β No tracking or analytics
- β
Settings stored locally via
chrome.storage.sync - β No data sent to external servers
- β Open source and auditable
MIT License - See LICENSE file for details
Found a bug? Have a feature request? Feel free to open an issue or submit a pull request!
- Modify
content.jsfor text/image replacement logic - Modify
options.htmlfor UI changes - Update
options.jsfor new settings or translation strings - Modify
options.cssfor styling
After changes:
- Go to
chrome://extensions - Click the reload icon next to "Trump Text Replacer"
- Test on a webpage
- Check if "Extension enabled" is toggled on
- Verify filter words are entered correctly
- Hard-refresh the page (
Ctrl+Shift+R) - Reload the extension via
chrome://extensions
- Some images may not be detected if they don't contain "trump" metadata
- Add more specific filter words in settings
- Check console for errors (
F12β Console)
- Ensure you're using a Google account (required for
chrome.storage.sync) - Check that sync is enabled in Chrome settings
- Try saving again; sync can take a few seconds
- β¨ Options page with full customization
- π Multi-language support (English/Dutch)
- π¦
chrome.storage.syncfor settings persistence - πΌοΈ Advanced image replacement (backgrounds, srcset)
- β‘ Improved performance with targeted DOM scanning
- Initial release with basic text/image replacement
- Hardcoded Trump terms and lorem ipsum replacements
Made with β€οΈ for a more serene web browsing experience