Skip to content

coherent-cache/domain-swap

Repository files navigation

Domain Swap

Domain Swap Logo

Mozilla Add-on Mozilla Add-on Mozilla Add-on License: MIT

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.

Features

  • 🔄 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)

Installation

From Firefox Add-ons

  1. Visit Domain Swap on Mozilla Add-ons
  2. Click "Add to Firefox"

From Chrome Web Store

Coming soon

From Source

  1. Clone the repository:
git clone https://github.com/coherent-cache/domain-swap.git
cd domain-swap
  1. Install dependencies:
npm install
  1. Build the extension:
npm run build
  1. Load in Firefox:
  • Navigate to about:debugging
  • Click "This Firefox"
  • Click "Load Temporary Add-on"
  • Select any file in the dist/firefox directory
  1. Load in Chrome:
  • Navigate to chrome://extensions
  • Enable "Developer mode"
  • Click "Load unpacked"
  • Select the dist/chrome directory

Usage

  1. Click the Domain Swap icon in your toolbar
  2. Add a domain you want to monitor
  3. Configure the match and replace patterns
  4. Visit a matching URL - it will automatically redirect

Example Patterns

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

Development

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)
  • Firefox Browser and/or Chrome Browser

Setup Development Environment

# 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

Building for Production

# 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

Security

  • 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

Release Notes

v1.1.0 (2025-04-05)

  • Added Chrome browser support
  • Cross-browser compatibility layer
  • System theme support
  • Improved error handling

v1.0.0 (2024-11-20)

  • Initial release
  • Domain pattern matching and replacement
  • Per-domain configuration
  • Real-time URL redirection
  • Secure pattern storage

Made with ❤️ by Coherent Cache

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors