Replace meme values with emojis across the web: 69 → ♋︎, 420 → 🌿, 666 → 😈, 1337 → 🤓
Works on Chrome, Firefox, and Safari with smart DOM filtering to avoid dialogs and input fields.
# Install dependencies
make install
# Development mode (watch + rebuild on changes)
make dev
# Build for production
make build
# Build for specific browser
make build-chrome # Creates chrome-extension.zip
make build-firefox # Creates firefox-extension.xpisrc/
├── core/ # Shared, framework-agnostic logic
│ ├── types.ts # TypeScript interfaces
│ ├── meme-map.json # Meme values database
│ ├── replacer.ts # Text replacement engine
│ ├── dom-walker.ts # DOM traversal logic
│ └── filters.ts # Node filtering (exclude dialogs, inputs, etc)
│
├── content/ # Content script (injected into pages)
│ └── content.ts # Main script entry point
│
└── background/ # Background service worker
└── background.ts # Configuration + message routing
✅ Smart Filtering - Only replaces text in static content, excludes:
- Dialog & modal windows
- Input fields & textareas
- Script & style tags
- Form elements
✅ Dynamic Content - Uses MutationObserver to catch content added via JavaScript
✅ Performance - Debounced processing (300ms), caching, TreeWalker API
✅ Multi-Browser - Single codebase, multiple manifest versions
✅ Extensible - Easy to add new meme values in src/core/meme-map.json
Edit src/core/meme-map.json to add or modify replacements:
{
"values": {
"69": "♋︎",
"420": "🌿",
"666": "😈",
"1337": "🤓"
},
"regexPatterns": [
{
"pattern": "\\b69\\b",
"replacement": "♋︎",
"enabled": true
}
]
}make dev # Watch mode - recompile on file changes
make type-check # Type check without emit
make lint # Lint codemake build # Build core assets
make build-chrome # Package for Chrome Web Store
make build-firefox # Package for Firefox Add-ons
make build-safari # Guidance for Safari (requires Xcode)make test # Run unit tests (Phase 2)
make test-watch # Watch mode tests (Phase 2)make clean # Remove build artifacts
make index # Update INDEX.md- filters.ts - Determines which DOM nodes to process
- replacer.ts - Compiles regex patterns, performs text replacement with caching
- dom-walker.ts - TreeWalker API integration for efficient traversal
- Runs on page load, walks entire DOM
- Sets up MutationObserver for dynamic content
- Listens for messages from background worker
- Manages extension configuration (storage)
- Routes messages between tabs
- Handles extension icon clicks
| Browser | Status | Manifest |
|---|---|---|
| Chrome | ✅ Ready | Manifest V3 |
| Firefox | ✅ Ready | WebExtensions |
| Safari | 📅 Phase 2 | Requires Xcode |
- TypeScript - Type-safe development
- Webpack - Module bundler
- Jest - Testing framework (Phase 2)
- Chrome Extensions API - Runtime API
- Initial Load: Content script walks entire DOM on page load
- Replacement: Text nodes are checked against regex patterns
- Mutation Handling: MutationObserver catches dynamically added content
- Debouncing: Rapid DOM changes are batched to prevent performance issues
- Caching: Processed text is cached to avoid re-processing
- Safari requires manual Xcode integration
- Dialog detection uses tag names, ARIA roles, CSS classes, and data attributes
- Performance scales with DOM size (typically < 500ms on initial load)
- Regex patterns must be valid JavaScript RegExp strings
- Phase 1 ✅ - Core setup, DOM walker, replacer engine
- Phase 2 📅 - Unit tests, popup UI, performance benchmarks
- Phase 3 📅 - Real-world testing, browser compatibility, distribution
- INDEX.md - AI context file with complete architecture
- PHASE_1_COMPLETE.md - Phase 1 deliverables
- Makefile - All available commands
Uses chrome.storage.local for persistent configuration across browser sessions.
scripting- Execute content scriptsactiveTab- Access current tabhost_permissions- Access to all URLs (except system pages)
# Clear build cache
make clean
make build# Type check
make type-check
# Rebuild type definitions
npm install# Run tests with verbose output
npm run test -- --verboseMIT
Written as a senior developer project. See PHASE_1_COMPLETE.md for detailed technical decisions.