A browser extension for Firefox and Chrome that automatically redirects domains based on custom patterns. Perfect for developers working with multiple environments or anyone needing to quickly switch between different domain variations.
- 🔄 Real-time domain redirection
- 📝 Custom regex pattern matching
- 🎯 Per-domain configuration
- 🔒 Secure local storage
- ⚡ Zero performance impact on non-matching domains
- 🌓 Light/Dark/System theme support
- 🌐 Cross-browser compatibility (Firefox & Chrome)
- Visit Domain Swap on Mozilla Add-ons
- Click "Add to Firefox"
Coming soon
- Clone the repository:
git clone https://github.com/coherent-cache/domain-swap.git
cd domain-swap- Install dependencies:
npm install- Build the extension:
npm run build- Load in Firefox:
- Navigate to
about:debugging - Click "This Firefox"
- Click "Load Temporary Add-on"
- Select any file in the
dist/firefoxdirectory
- Load in Chrome:
- Navigate to
chrome://extensions - Enable "Developer mode"
- Click "Load unpacked"
- Select the
dist/chromedirectory
- Click the Domain Swap icon in your toolbar
- Add a domain you want to monitor
- Configure the match and replace patterns
- Visit a matching URL - it will automatically redirect
| Use Case | Match Pattern | Replace Pattern |
|---|---|---|
| Development to Production | ^dev\.(.+)\.com$ |
$1.com |
| Staging to Local | ^staging\.(.+)\.com$ |
localhost:3000 |
| Domain Swap | ^example\.com$ |
testexample.com |
- Node.js (v14 or higher)
- npm (v6 or higher)
- Firefox Browser and/or Chrome Browser
# Install dependencies
npm install
# Start development mode (Firefox)
npm run dev
# Start development mode (Chrome)
npm run dev:chrome
# Run tests
npm test
# Lint code
npm run lint# Create production build (both Firefox and Chrome)
npm run build
# Create Firefox-only build
npm run build:firefox
# Create Chrome-only build
npm run build:chrome- Report vulnerabilities to domain-swap-support@rbkv2.in
- All pattern matching is done locally
- No data is sent to external servers
- All storage is local to the browser
This project is licensed under the MIT License - see the LICENSE file for details.
- Icons by Denali Design licensed under MIT License via SVG Repo
- Added Chrome browser support
- Cross-browser compatibility layer
- System theme support
- Improved error handling
- Initial release
- Domain pattern matching and replacement
- Per-domain configuration
- Real-time URL redirection
- Secure pattern storage
Made with ❤️ by Coherent Cache