Version: 0.1.0 (Phase 1)
Last Updated: 2026-01-28
Status: Setup & Core Architecture
Cross-browser extension that replaces meme/joke values with corresponding emojis.
- Chrome: Manifest V3
- Firefox: WebExtensions API
- Safari: App Extensions framework
- Replace text patterns (e.g., "69" → "♋︎") only in static text
- Exclude: dialogs, input fields, textareas, script/style tags
- Support dynamic DOM changes (MutationObserver)
- Maintain performance on large sites
- Support multiple regex patterns
src/
├── core/ # Shared, framework-agnostic logic
│ ├── meme-map.json # Meme values → emoji mappings
│ ├── dom-walker.ts # TreeWalker implementation
│ ├── replacer.ts # Text replacement engine
│ ├── filters.ts # Node filtering (exclude dialog, input, etc)
│ └── types.ts # TypeScript interfaces
│
├── content/ # Content script (injected into pages)
│ ├── content.ts # Main content script
│ ├── observer.ts # MutationObserver handler
│ └── style.css # Optional styling
│
├── background/ # Background worker
│ ├── background.ts # Background service worker
│ └── storage.ts # Configuration storage
│
├── popup/ # UI (future)
│ ├── popup.html
│ ├── popup.ts
│ └── popup.css
│
└── browser/ # Browser-specific wrappers
├── chrome.ts # Chrome API wrapper
├── firefox.ts # Firefox API wrapper
└── safari.ts # Safari API wrapper
{
"values": {
"69": "♋︎",
"420": "🌿",
"666": "😈",
"1337": "🤓"
},
"regex_patterns": [
{ "pattern": "\\b69\\b", "replacement": "♋︎", "enabled": true }
]
}- Uses TreeWalker API for efficient traversal
- Only processes text nodes
- Respects exclude list (script, style, dialog, input, textarea, select)
- Word boundary detection
- Caching for performance
- Safe HTML preservation
- Load meme map from storage/defaults
- Walk DOM and replace matching text nodes
- Listen for MutationObserver changes
- Debounce replacements for performance
make install # npm install
make dev # webpack watchmake build # Build all core assets
make build-chrome # Create Chrome package
make build-firefox# Create Firefox package
make build-safari # Create Safari packagepermissions: ["scripting", "activeTab"]content_scripts: Match all URLs except restricted domainshost_permissions: Required for DOM access
permissions: ["webRequest"]content_scripts: Same as Chrome but adapted
- Xcode project integration
- Different permission model (more restricted)
core/replacer.test.ts- Replacement logiccore/dom-walker.test.ts- DOM traversalcore/filters.test.ts- Node filtering
content/content.test.ts- Full content script flow- Test against mock DOM structures
- Test on sites: GitHub, Twitter, Reddit, Medium
- Verify dialogs/inputs NOT affected
- Performance testing (100+ replacements)
| Challenge | Solution |
|---|---|
| MutationObserver spam | Debouncing + batching |
| Dialog/Input detection | Exclude list + parent check |
| Unicode rendering | Test on multiple browsers |
| Safari permissions | More restricted API surface |
| Cache invalidation | Version-based + manual clear |
- Project scaffolding (package.json, tsconfig.json)
- Webpack configuration
- Makefile with build commands
- Directory structure
- Manifest files (Chrome, Firefox, Safari)
- Core types & interfaces
- DOM walker implementation
- Replacer engine
- Meme map
- Content script boilerplate
- Background script boilerplate
- Node.js 18+
- npm 8+
- TypeScript 5.0+
- Webpack 5.x
- Exclude domains: chrome://, about://, firefox://, data:// URLs
- Performance: Max 500ms per DOM walk on initial load
- Storage: Use browser's storage API (extension context)
- Permissions: Minimal required set only
- Versioning: Semantic versioning (MAJOR.MINOR.PATCH)
- Create manifest files for all browsers
- Implement core types
- Build DOM walker
- Implement replacer engine
- Create meme-map.json
- Wire content script to core
- Test on real sites