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.