{"id":50493762,"url":"https://github.com/jordibrouwer/trumpswap","last_synced_at":"2026-06-02T05:03:29.658Z","repository":{"id":334757184,"uuid":"1142770417","full_name":"jordibrouwer/TrumpSwap","owner":"jordibrouwer","description":"A Chrome extension (Manifest V3) that replaces Trump-related terms and images on webpages with configurable lorem ipsum text and orange placeholder images. ","archived":false,"fork":false,"pushed_at":"2026-01-26T20:52:32.000Z","size":1667,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-27T05:39:26.966Z","etag":null,"topics":["chrome-extension","edge-extension","text-replacement","trump"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordibrouwer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-26T20:47:22.000Z","updated_at":"2026-01-26T20:53:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jordibrouwer/TrumpSwap","commit_stats":null,"previous_names":["jordibrouwer/trumpswap"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jordibrouwer/TrumpSwap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordibrouwer%2FTrumpSwap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordibrouwer%2FTrumpSwap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordibrouwer%2FTrumpSwap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordibrouwer%2FTrumpSwap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordibrouwer","download_url":"https://codeload.github.com/jordibrouwer/TrumpSwap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordibrouwer%2FTrumpSwap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33806995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-extension","edge-extension","text-replacement","trump"],"created_at":"2026-06-02T05:03:27.018Z","updated_at":"2026-06-02T05:03:29.633Z","avatar_url":"https://github.com/jordibrouwer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TrumpSwap chrome extension\n\nA 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.\n\n## Features\n\n✨ **Configurable Text Replacement**\n- Replace Trump-related terms with custom lorem ipsum or any text you prefer\n- Enter multiple replacement texts (one per line) for random selection\n\n🖼️ **Image Replacement**\n- Automatically detects and replaces images containing \"trump\" in metadata\n- Replaces `\u003cimg\u003e` tags, `\u003csource srcset\u003e` elements, and CSS background images\n- Uses an inline SVG orange placeholder image\n\n🌍 **Multi-Language Support**\n- English and Dutch UI language options\n- Settings saved per language preference\n\n⚙️ **Advanced Options**\n- Enable/disable the extension without uninstalling\n- Case-sensitive or case-insensitive filtering\n- Periodic DOM rescanning (every 2 seconds) for stubborn stylesheet updates\n- Mutation observer for dynamic content detection\n\n## Installation\n\n### From Chrome Web Store\n*(If published)*\n\n### Manual Installation (Developer Mode)\n\n1. Clone or download this repository\n2. Open Chrome and navigate to `chrome://extensions`\n3. Enable **Developer mode** (toggle in top right)\n4. Click **\"Load unpacked\"**\n5. Select the project folder\n\nThe extension is now active on all websites you visit!\n\n## Usage\n\n### Opening Settings\n\n**Option 1:** Right-click the extension icon → **\"Options\"**\n\n**Option 2:** Go to `chrome://extensions` → Find \"Trump Text Replacer\" → Click **\"Details\"** → **\"Extension options\"**\n\n### Configuring Filters\n\n#### Extension Status\n- Toggle **\"Extension enabled\"** to temporarily disable/enable without uninstalling\n\n#### Filter Words\n- Enter one search term per line (e.g., \"Trump\", \"Donald Trump\")\n- All occurrences are replaced (case-sensitive or insensitive based on settings)\n- Default: `Trump`, `Donald Trump`, `President Trump`, `Trump Jr.`\n\n#### Replacement Text\n- Enter one replacement text per line\n- Each replacement randomly selects from these options\n- Default: Lorem ipsum sentences\n\n#### Options\n- **Case-sensitive filtering**: When enabled, \"Trump\" ≠ \"trump\"\n- **Language**: Choose between English (English) or Dutch (Nederlands)\n\n### How It Works\n\n1. **Settings Storage**: All settings are stored in `chrome.storage.sync`\n   - Synchronizes across devices using the same Google account\n   - Persists between browser sessions\n\n2. **Content Script**: On every page load, the content script:\n   - Fetches settings from `chrome.storage.sync`\n   - Checks if the extension is enabled\n   - Builds a dynamic regex from your filter words\n   - Scans the entire DOM for text, images, and backgrounds\n   - Replaces matches with your configured text/images\n\n3. **Dynamic Updates**: A `MutationObserver` watches for:\n   - New DOM elements being added\n   - Attribute changes (src, alt, style, etc.)\n   - Periodic rescans every 2 seconds for stubborn stylesheets\n\n## File Structure\n\n```\ntrump-text-replacer/\n├── manifest.json           # Chrome extension configuration (Manifest V3)\n├── content.js              # Main script that performs replacements\n├── options.html            # Settings page UI\n├── options.js              # Settings page logic (load/save)\n├── options.css             # Settings page styling\n├── icons/\n│   ├── icon16.png          # Extension icon (16x16)\n│   ├── icon48.png          # Extension icon (48x48)\n│   └── icon128.png         # Extension icon (128x128)\n└── README.md               # This file\n```\n\n## Technical Details\n\n### Manifest V3\n- Modern Chrome extension format\n- Supports `chrome.storage.sync` for settings persistence\n- Uses `options_ui` for the settings page\n- Content script matches all `http://*` and `https://*` URLs\n\n### Regex Generation\nFilter words are escaped and combined into a word-boundary regex:\n- Case-sensitive: `/\\b(Trump|Donald Trump|President Trump|Trump Jr\\.)\\b/g`\n- Case-insensitive: `/\\b(Trump|Donald Trump|President Trump|Trump Jr\\.)\\b/gi`\n\n### Image Detection\nImages are considered \"Trump-related\" if they contain \"trump\" (case-insensitive) in:\n- `alt` attribute\n- `title` attribute\n- `aria-label` attribute\n- `src` URL\n- Background image URL\n\n### DOM Traversal\n- **Text nodes**: TreeWalker skips `\u003cscript\u003e`, `\u003cstyle\u003e`, `\u003ctextarea\u003e`, `\u003cinput\u003e` elements\n- **Attributes**: Mutation observer monitors `src`, `alt`, `title`, `srcset`, `style`, `class`\n- **Rescan**: Every 2 seconds to catch dynamic content and stylesheet changes\n\n## Localization\n\nText strings are managed in `options.js` via the `TRANSLATIONS` object:\n\n```javascript\nconst TRANSLATIONS = {\n  en: { /* English strings */ },\n  nl: { /* Dutch strings */ }\n};\n```\n\nAdd more languages by:\n1. Adding a new language object to `TRANSLATIONS`\n2. Adding a new `\u003coption\u003e` to the language selector in `options.html`\n3. Updating the UI text with `data-i18n` attributes\n\n## Browser Support\n\n- **Chrome 88+** (Manifest V3 support)\n- **Edge 88+** (Chromium-based)\n- **Other Chromium browsers** (Opera, Brave, etc.)\n\n## Privacy\n\n- ✅ No tracking or analytics\n- ✅ Settings stored locally via `chrome.storage.sync`\n- ✅ No data sent to external servers\n- ✅ Open source and auditable\n\n## License\n\nMIT License - See `LICENSE` file for details\n\n## Contributing\n\nFound a bug? Have a feature request? Feel free to open an issue or submit a pull request!\n\n### Development Tips\n\n1. Modify `content.js` for text/image replacement logic\n2. Modify `options.html` for UI changes\n3. Update `options.js` for new settings or translation strings\n4. Modify `options.css` for styling\n\nAfter changes:\n- Go to `chrome://extensions`\n- Click the reload icon next to \"Trump Text Replacer\"\n- Test on a webpage\n\n## Troubleshooting\n\n### Extension not replacing text\n1. Check if **\"Extension enabled\"** is toggled on\n2. Verify filter words are entered correctly\n3. Hard-refresh the page (`Ctrl+Shift+R`)\n4. Reload the extension via `chrome://extensions`\n\n### Images still showing\n1. Some images may not be detected if they don't contain \"trump\" metadata\n2. Add more specific filter words in settings\n3. Check console for errors (`F12` → Console)\n\n### Settings not saving\n1. Ensure you're using a Google account (required for `chrome.storage.sync`)\n2. Check that sync is enabled in Chrome settings\n3. Try saving again; sync can take a few seconds\n\n## Version History\n\n### v2.0.0 (Current)\n- ✨ Options page with full customization\n- 🌍 Multi-language support (English/Dutch)\n- 📦 `chrome.storage.sync` for settings persistence\n- 🖼️ Advanced image replacement (backgrounds, srcset)\n- ⚡ Improved performance with targeted DOM scanning\n\n### v1.0.0\n- Initial release with basic text/image replacement\n- Hardcoded Trump terms and lorem ipsum replacements\n\n---\n\n**Made with ❤️ for a more serene web browsing experience**\n#\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordibrouwer%2Ftrumpswap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordibrouwer%2Ftrumpswap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordibrouwer%2Ftrumpswap/lists"}